From: Martin Quinson Date: Thu, 27 Aug 2015 17:46:48 +0000 (+0200) Subject: Merge branch 'master' into S4U X-Git-Tag: v3_13~1690^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2dacf5b5e81474fb89d8234b907f6f61b623983e?hp=e03ba5e826a3b2422d4bb300fe3949bed0f71712 Merge branch 'master' into S4U --- diff --git a/.gitignore b/.gitignore index 4b208aac55..6e70b85c5a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ ### cmake CTestCustom.cmake +CTestResults.xml ### Maintainer mode src/simdag/dax_dtd.l diff --git a/.travis.yml b/.travis.yml index 92cf324700..f8f1d37b7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ before_install: - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 50 - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50 script: - - cmake -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . && make && ctest --output-on-failure --timeout 100 + - cmake -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . && make VERBOSE=1 && ctest --output-on-failure --timeout 100 branches: only: - master diff --git a/CMakeLists.txt b/CMakeLists.txt index f60a3966d9..51940649e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,19 @@ cmake_minimum_required(VERSION 2.6) +project(SimGrid C CXX) + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# Check for the compiler # +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# + ### Need to set rc ccompiler before enable language if(WIN32) SET(CMAKE_RC_COMPILER "windres") endif() -project(SimGrid C) ## ## Check the C/C++ standard that we need ## See also tools/cmake/Flags.cmake that sets our paranoid warning flags - -enable_language(CXX) - INCLUDE(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER) @@ -50,6 +52,12 @@ else() "Please use a decent C compiler " "(note that c++11 support of ${CMAKE_CXX_COMPILER} seems ok).") endif() +if(APPLE AND ("4.6" GREATER COMPILER_C_VERSION_MAJOR_MINOR)) + ### gcc 4.[1-5] cannot compile ucontext on OSX + message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)") + set(HAVE_UCONTEXT_H 0) +endif() + ### SMPI vs. Fortran if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by default @@ -76,18 +84,16 @@ if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by enable_language(Fortran OPTIONAL) endif() -## Mapping version number -> version name -# 3.5.99 -> alpha1 (oops) -# 3.5.9{1,2} -> beta{1,2} -# 3.5.9{3,4,5} -> rc{1,2,3} -# 3.6.{0,1,2} -> release 3.6, 3.6.1, 3.6.2 -# 3.7.{0,1} -> release 3.7, 3.7.1 -# 3.8.{0,1} -> release 3.8, 3.8.1 -# 3.9.0 -> release 3.9 -# 3.9.90 -> release 3.10pre1 -# 3.10.0 -> release 3.10 -# 3.11.0 -> release 3.11 -# 3.12.0 -> release 3.12 +if (CMAKE_COMPILER_IS_GNUCC) + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8") + set (CMAKE_AR gcc-ar) + set (CMAKE_RANLIB gcc-ranlib) + endif() +endif() + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# Build the version number # +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# set(SIMGRID_VERSION_MAJOR "3") set(SIMGRID_VERSION_MINOR "12") @@ -108,10 +114,8 @@ set(SIMGRID_VERSION_BANNER set(libsimgrid_version "${release_version}") set(libsimgrid-java_version "${release_version}") -set(GCC_NEED_VERSION "4.0") -set(APPLE_NEED_GCC_VERSION "4.6") -### SET THE LIBRARY EXTENSION AND GCC VERSION +### SET THE LIBRARY EXTENSION if(APPLE) #MAC set(LIB_EXE "dylib") else() @@ -130,17 +134,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU") string(REGEX MATCH "[0-9].[0-9].[0-9]" COMPILER_CXX_VERSION "${COMPILER_CXX_VERSION}") string(REGEX MATCH "^[0-9].[0-9]" COMPILER_C_VERSION_MAJOR_MINOR "${COMPILER_C_VERSION}") - string(REPLACE "${COMPILER_C_VERSION_MAJOR_MINOR}." "" COMPILER_C_VERSION_PATCH "${COMPILER_C_VERSION}") - - if(${GCC_NEED_VERSION} GREATER COMPILER_C_VERSION_MAJOR_MINOR) - message(FATAL_ERROR "Gcc must be to version ${GCC_NEED_VERSION} current version ${COMPILER_C_VERSION_MAJOR_MINOR}") - endif() - - if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8") - set (CMAKE_AR gcc-ar) - set (CMAKE_RANLIB gcc-ranlib) - endif() - + string(REPLACE "${COMPILER_C_VERSION_MAJOR_MINOR}." "" COMPILER_C_VERSION_PATCH "${COMPILER_C_VERSION}") endif() exec_program("${CMAKE_LINKER} --version" OUTPUT_VARIABLE "LINKER_VERSION") @@ -220,12 +214,6 @@ if(WIN32) message("You REALLY should use MinGW to compile SimGrid on Windows!") endif() - if(ARCH_32_BITS) ### Arch 32bits - set(_WIN32 1) - else() ### Arch 64bits - set(_WIN64 1) - endif() - set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITEW6432}) if(NSIS_WIN_VERSION MATCHES "") set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITECTURE}) @@ -236,8 +224,8 @@ if(WIN32) set(_XBT_WIN32 1) - message(STATUS "C_COMPILER ${CMAKE_C_COMPILER} ${COMPILER_C_VERSION}") - message(STATUS "CXX_COMPILER ${CMAKE_CXX_COMPILER} ${COMPILER_CXX_VERSION}") + message(STATUS "C_COMPILER ${CMAKE_C_COMPILER} ${COMPILER_C_VERSION_MAJOR_MINOR}") + message(STATUS "CXX_COMPILER ${CMAKE_CXX_COMPILER} ${COMPILER_CXX_VERSION_MAJOR_MINOR}") message(STATUS "CMAKE_RC_COMPILER ${CMAKE_RC_COMPILER}") message(STATUS "INCLUDE ${CMAKE_INCLUDE_WIN}") message(STATUS "LIB ${CMAKE_LIB_WIN}") diff --git a/examples/smpi/mc/only_send_deterministic.tesh b/examples/smpi/mc/only_send_deterministic.tesh index 6484cc9165..c315df9756 100644 --- a/examples/smpi/mc/only_send_deterministic.tesh +++ b/examples/smpi/mc/only_send_deterministic.tesh @@ -7,8 +7,8 @@ $ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-m > [0.000000] [mc_global/INFO] **** Only-send-deterministic communication pattern **** > [0.000000] [mc_global/INFO] ****************************************************** > [0.000000] [mc_global/INFO] The recv communications pattern of the process 0 is different! Different source for communication #2 -> [0.000000] [mc_global/INFO] Expanded states = 1025 -> [0.000000] [mc_global/INFO] Visited states = 3640 -> [0.000000] [mc_global/INFO] Executed transitions = 3360 +> [0.000000] [mc_global/INFO] Expanded states = 520 +> [0.000000] [mc_global/INFO] Visited states = 1476 +> [0.000000] [mc_global/INFO] Executed transitions = 1312 > [0.000000] [mc_global/INFO] Send-deterministic : Yes > [0.000000] [mc_global/INFO] Recv-deterministic : No diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index 4dfc427c71..4503597f38 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -650,7 +650,7 @@ char *MC_request_get_dot_output(smx_simcall_t req, int value) break; case SIMCALL_MUTEX_LOCK: - label = bprintf("[(%lu)] Mutex LOCK", req->issuer->pid); + label = bprintf("[(%lu)] Mutex LOCK", issuer->pid); break; case SIMCALL_MC_RANDOM: diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index a61c0e592f..da028dea0b 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -341,11 +341,17 @@ void smpi_mpi_start(MPI_Request request) if (request->flags & RECV) { print_request("New recv", request); - - xbt_mutex_t mut=smpi_process_mailboxes_mutex(); - xbt_mutex_acquire(mut); - - if (request->flags & RMA || request->size < sg_cfg_get_int("smpi/async_small_thres")){ + + int async_small_thres = sg_cfg_get_int("smpi/async_small_thres"); + + xbt_mutex_t mut = smpi_process_mailboxes_mutex(); + if (async_small_thres != 0 ||request->flags & RMA) + xbt_mutex_acquire(mut); + + if (async_small_thres == 0 && !(request->flags & RMA)) { + mailbox = smpi_process_mailbox(); + } + else if (request->flags & RMA || request->size < async_small_thres){ //We have to check both mailboxes (because SSEND messages are sent to the large mbox). begin with the more appropriate one : the small one. mailbox = smpi_process_mailbox_small(); XBT_DEBUG("Is there a corresponding send already posted in the small mailbox %p (in case of SSEND)?", mailbox); @@ -393,7 +399,8 @@ void smpi_mpi_start(MPI_Request request) request, -1.0); XBT_DEBUG("recv simcall posted"); - xbt_mutex_release(mut); + if (async_small_thres != 0 || request->flags & RMA) + xbt_mutex_release(mut); } else { @@ -416,11 +423,18 @@ void smpi_mpi_start(MPI_Request request) simcall_process_sleep(sleeptime); XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size)); } - + + int async_small_thres = sg_cfg_get_int("smpi/async_small_thres"); + xbt_mutex_t mut=smpi_process_remote_mailboxes_mutex(receiver); - xbt_mutex_acquire(mut); - - if (request->flags & RMA || request->size < sg_cfg_get_int("smpi/async_small_thres")) { // eager mode + + if (async_small_thres != 0 || request->flags & RMA) + xbt_mutex_acquire(mut); + + if (!(async_small_thres != 0 || request->flags & RMA)) { + mailbox = smpi_process_remote_mailbox(receiver); + } + else if (request->flags & RMA || request->size < async_small_thres) { // eager mode mailbox = smpi_process_remote_mailbox(receiver); XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %p?", mailbox); smx_synchro_t action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, (void*)request); @@ -489,7 +503,8 @@ void smpi_mpi_start(MPI_Request request) if (request->action) simcall_set_category(request->action, TRACE_internal_smpi_get_category()); - xbt_mutex_release(mut); + if (async_small_thres != 0 || request->flags & RMA) + xbt_mutex_release(mut); } } diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 812acdbdfc..f27daa8240 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -45,7 +45,11 @@ Options: -trace-viva # generate configuration for Viva's GraphView -trace-file # name of the tracefile (simgrid_smpi.trace) -ext # additional parameter (reserved) - + -foreground # run the child process in the foreground: + # - it can access the terminal; + # - but we cannot stop it when we receive a signal. + # This is useful with -wrapper "gdb --args". + -version # Displays the SimGrid version (human readable) -git-version # Displays the git hash of SimGrid @@ -65,6 +69,58 @@ fi EXTOPT="" WRAPPER="" HOSTFILE="" +HOSTFILETMP=0 + +unset pid +unset foreground ; foreground=0 + +trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS" + +smpirun_cleanup() +{ + if [ -z "${KEEP}" ] ; then + if [ -z "${PLATFORM}" -a -n "$PLATFORMTMP" ]; then + rm -f ${PLATFORMTMP} + PLATFORMTMP="" + fi + if [ ${HOSTFILETMP} = 1 -a -n "$HOSTFILE" ] ; then + rm -f ${HOSTFILE} + HOSTFILE="" + fi + if [ ${UNROLLEDHOSTFILETMP} = 1 -a -n "$UNROLLEDHOSTFILE" ] ; then + rm -f ${UNROLLEDHOSTFILE} + UNROLLEDHOSTFILE="" + fi + if [ -n ${APPLICATIONTMP} ]; then + rm -f ${APPLICATIONTMP} + APPLICATIONTMP="" + fi + fi +} + +smpirun_trap() { + local sig + sig="$1" + + # Cleanup and kill the child process: + smpirun_cleanup + if ! [ -z "$pid" ]; then + kill -TERM $pid + fi + unset pid + + # Raise the same signal again (remove the traps first): + trap - $trapped_signals + kill -$sig $$ + + # This should never happen: + kill -ABRT $$ + kill -TERM $$ +} + +for s in $trapped_signals; do + trap "smpirun_trap $s" $s +done while true; do case "$1" in @@ -189,6 +245,10 @@ while true; do done shift 1 ;; + "-foreground") + foreground=1 + shift 1 + ;; *) break ;; @@ -229,7 +289,6 @@ if [ -z "${HOSTFILE}" ] && [ -z "${PLATFORM}" ] ; then exit 1 fi -HOSTFILETMP=0 if [ -z "${HOSTFILE}" ] ; then HOSTFILETMP=1 HOSTFILE="$(mktemp tmphostXXXXXX)" @@ -458,20 +517,17 @@ if [ -n "${KEEP}" ] ; then echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} keeped." fi fi -${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} -status=$? - -if [ -z "${KEEP}" ] ; then - if [ -z "${PLATFORM}" ]; then - rm ${PLATFORMTMP} - fi - if [ ${HOSTFILETMP} = 1 ] ; then - rm ${HOSTFILE} - fi - if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then - rm ${UNROLLEDHOSTFILE} - fi - rm ${APPLICATIONTMP} +if [ "$foreground" = 1 ]; then + ${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} + status=$? +else + ${EXEC} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP} & + pid=$! + wait $pid + status=$? + pid="" fi +smpirun_cleanup + exit $status diff --git a/teshsuite/mc/CMakeLists.txt b/teshsuite/mc/CMakeLists.txt index 5c2f3d20e1..b6e1d81c15 100644 --- a/teshsuite/mc/CMakeLists.txt +++ b/teshsuite/mc/CMakeLists.txt @@ -4,11 +4,26 @@ if(HAVE_MC) set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") endif() +add_executable(mutex_handling mutex_handling.c) +target_link_libraries(mutex_handling simgrid) + +add_executable(no_mutex_handling mutex_handling.c) +target_link_libraries(no_mutex_handling simgrid) +set_target_properties(no_mutex_handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1) + set(tesh_files ${tesh_files} + ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/no_mutex_handling.tesh PARENT_SCOPE ) set(testsuite_src ${testsuite_src} + ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.c + PARENT_SCOPE + ) +set(xml_files + ${xml_files} + ${CMAKE_CURRENT_SOURCE_DIR}/mutex_handling.xml PARENT_SCOPE ) diff --git a/teshsuite/mc/mutex_handling.c b/teshsuite/mc/mutex_handling.c new file mode 100644 index 0000000000..4db2783552 --- /dev/null +++ b/teshsuite/mc/mutex_handling.c @@ -0,0 +1,93 @@ +/* Copyright (c) 2015. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +/* In this test, we have two senders sending one message to a common receiver. + * The receiver should be able to see any ordering between the two messages. + * If we model-check the application with assertions on a specific order of + * the messages (see the assertions in the receiver code), it should fail + * because both ordering are possible. + * + * If the senders sends the message directly, the current version of the MC + * finds that the ordering may differ and the MC find a counter-example. + * + * However, if the senders send the message in a mutex, the MC always let + * the first process take the mutex because it thinks that the effect of + * a mutex is purely local: the ordering of the messages is always the same + * and the MC does not find the counter-example. + */ + +#include +#include "simgrid/msg.h" +#include "xbt/log.h" +#include "mc/mc.h" +#include + +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, + "Messages specific for this msg example"); + +#define BOX_NAME "box" + +#ifndef DISABLE_THE_MUTEX +static xbt_mutex_t mutex = NULL; +#endif + +static int receiver(int argc, char *argv[]) +{ + msg_task_t task = NULL; + + MSG_task_receive(&task, BOX_NAME); + MC_assert(strcmp(MSG_task_get_name(task), "X") == 0); + MSG_task_destroy(task); + + MSG_task_receive(&task, BOX_NAME); + MC_assert(strcmp(MSG_task_get_name(task), "Y") == 0); + MSG_task_destroy(task); + + return 0; +} + +static int sender(int argc, char *argv[]) +{ + char* message_name = argv[1]; +#ifndef DISABLE_THE_MUTEX + xbt_mutex_acquire(mutex); +#endif + MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME); +#ifndef DISABLE_THE_MUTEX + xbt_mutex_release(mutex); +#endif + return 0; +} + +int main(int argc, char *argv[]) +{ + MSG_init(&argc, argv); + if (argc != 3) { + printf("Usage: %s platform_file deployment_file\n", argv[0]); + printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); + exit(1); + } + const char *platform_file = argv[1]; + const char *application_file = argv[2]; + MSG_create_environment(platform_file); + MSG_function_register("receiver", receiver); + MSG_function_register("sender", sender); + + MSG_launch_application(application_file); +#ifndef DISABLE_THE_MUTEX + mutex = xbt_mutex_init(); +#endif + msg_error_t res = MSG_main(); +#ifndef DISABLE_THE_MUTEX + xbt_mutex_destroy(mutex); mutex = NULL; +#endif + XBT_INFO("Simulation time %g", MSG_get_clock()); + + if (res == MSG_OK) + return 0; + else + return 1; +} \ No newline at end of file diff --git a/teshsuite/mc/mutex_handling.tesh b/teshsuite/mc/mutex_handling.tesh new file mode 100644 index 0000000000..4839f3f5de --- /dev/null +++ b/teshsuite/mc/mutex_handling.tesh @@ -0,0 +1,4 @@ +#!/usr/bin/env tesh +! expect return 1 +! output ignore +$ ${bindir:=.}/../../bin/simgrid-mc ${bindir:=.}/mutex_handling --cfg=model-check:1 ../../examples/platforms/platform.xml mutex_handling.xml diff --git a/teshsuite/mc/mutex_handling.xml b/teshsuite/mc/mutex_handling.xml new file mode 100644 index 0000000000..73e165aba6 --- /dev/null +++ b/teshsuite/mc/mutex_handling.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/teshsuite/mc/no_mutex_handling.tesh b/teshsuite/mc/no_mutex_handling.tesh new file mode 100644 index 0000000000..58f31e8131 --- /dev/null +++ b/teshsuite/mc/no_mutex_handling.tesh @@ -0,0 +1,4 @@ +#!/usr/bin/env tesh +! expect return 1 +! output ignore +$ ${bindir:=.}/../../bin/simgrid-mc ${bindir:=.}/no_mutex_handling --cfg=model-check:1 ../../examples/platforms/platform.xml mutex_handling.xml diff --git a/tools/cmake/AddTests.cmake b/tools/cmake/AddTests.cmake index 887e358225..6e15755de5 100644 --- a/tools/cmake/AddTests.cmake +++ b/tools/cmake/AddTests.cmake @@ -101,6 +101,11 @@ IF(NOT enable_memcheck) ADD_TESH(tesh-mc-dwarf --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf dwarf.tesh) ADD_TESH(tesh-mc-dwarf-expression --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf_expression --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf_expression dwarf_expression.tesh) + ADD_TESH(tesh-mc-mutex-handling --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc mutex_handling.tesh --cfg=model-check/reduction:none) + ADD_TESH(tesh-mc-mutex-handling-dpor --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc mutex_handling.tesh --cfg=model-check/reduction:dpor) + ADD_TESH(tesh-mc-no-mutex-handling --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc no_mutex_handling.tesh --cfg=model-check/reduction:none) + ADD_TESH(tesh-mc-no-mutex-handling-dpor --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc no_mutex_handling.tesh --cfg=model-check/reduction:dpor) + ADD_TESH(mc-record-random-bug --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/replay --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/mc/replay --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/replay random_bug.tesh) ADD_TESH_FACTORIES(mc-bugged1 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh) diff --git a/tools/cmake/CompleteInFiles.cmake b/tools/cmake/CompleteInFiles.cmake index 26f50efb74..1b37d52ce3 100644 --- a/tools/cmake/CompleteInFiles.cmake +++ b/tools/cmake/CompleteInFiles.cmake @@ -794,14 +794,6 @@ if(ADDR2LINE) set(ADDR2LINE "${ADDR2LINE}/addr2line") endif() -### Check if OSX can compile with ucontext (with gcc 4.[1-5] it is broken) -if(APPLE) - if(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR) - message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)") - set(HAVE_UCONTEXT_H 0) - endif() -endif() - ### File to create configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in" diff --git a/tools/fix-paje-trace.sh b/tools/fix-paje-trace.sh index 5305d78b53..211a727498 100755 --- a/tools/fix-paje-trace.sh +++ b/tools/fix-paje-trace.sh @@ -26,7 +26,7 @@ do GREP="/^$i /d; $GREP" GREP2="-e '^$i ' $GREP2" done -GREP="/^%\ /d; /^%E/d; $GREP" +GREP="/^%\ /d; /^% /d; /^%E/d; $GREP" cat $TRACE | eval grep $GREP2 > types /bin/sed -e "$GREP" $TRACE > events diff --git a/tools/tesh/tesh.pl b/tools/tesh/tesh.pl index 4bbeb20fca..2dd685b593 100755 --- a/tools/tesh/tesh.pl +++ b/tools/tesh/tesh.pl @@ -280,6 +280,8 @@ sub exec_cmd { die "fork() failed: $!" unless defined $forked; if ( $forked == 0 ) { # child sleep $time_to_wait; + kill(SIGTERM, $cmd{'pid'}); + sleep 1; kill(SIGKILL, $cmd{'pid'}); exit $time_to_wait; } @@ -363,7 +365,7 @@ sub parse_out { # Did we timeout ? If yes, handle it. If not, kill the forked process. - if($timeout==-1 and $gotret eq "got signal SIGKILL"){ + if($timeout==-1 and ($gotret eq "got signal SIGTERM" or $gotret eq "got signal SIGKILL")){ $gotret="return code 0"; $timeout=1; $gotret= "timeout after $time_to_wait sec";