From 92a60ce6d6a1694aa6b420d25c0a5b83b251a99c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 16 Oct 2012 21:31:57 +0200 Subject: [PATCH 1/1] Distinguish outputs for mmalloc_test on 32 and 64bits architectures. --- buildtools/Cmake/AddTests.cmake | 6 +- buildtools/Cmake/memcheck_tests.cmake | 6 +- teshsuite/xbt/mmalloc_32.tesh | 109 ++++++++++++++++++ .../xbt/{mmalloc.tesh => mmalloc_64.tesh} | 0 4 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 teshsuite/xbt/mmalloc_32.tesh rename teshsuite/xbt/{mmalloc.tesh => mmalloc_64.tesh} (100%) diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index bfd3b89945..40e5175a98 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -50,7 +50,11 @@ if(NOT enable_memcheck) # teshsuite/xbt ADD_TEST(xbt-log-large ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/log_large_test.tesh) ADD_TEST(xbt-log-parallel ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parallel_log_crashtest.tesh) - ADD_TEST(xbt-mmalloc ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc.tesh) + IF(${ARCH_32_BITS}) + ADD_TEST(xbt-mmalloc-32 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_32.tesh) + ELSE(${ARCH_32_BITS}) + ADD_TEST(xbt-mmalloc-64 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/mmalloc_64.tesh) + ENDIF(${ARCH_32_BITS}) # teshsuite/gras/datadesc directory ADD_TEST(tesh-gras-dd-mem ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cd ${CMAKE_BINARY_DIR}/teshsuite ${CMAKE_HOME_DIRECTORY}/teshsuite/gras/datadesc/datadesc_mem.tesh) diff --git a/buildtools/Cmake/memcheck_tests.cmake b/buildtools/Cmake/memcheck_tests.cmake index 3a3c21f45b..faa1887d2c 100644 --- a/buildtools/Cmake/memcheck_tests.cmake +++ b/buildtools/Cmake/memcheck_tests.cmake @@ -7,7 +7,11 @@ ADD_TEST(help-models ${CMAKE_BINARY_DIR}/teshsuite/simd ADD_TEST(memcheck-xbt-log-large-0 ${CMAKE_BINARY_DIR}/teshsuite/xbt/log_large_test "--log=root.fmt:%m%n" --cd ${CMAKE_BINARY_DIR}/teshsuite/) ADD_TEST(memcheck-xbt-log-large-1 ${CMAKE_BINARY_DIR}/teshsuite/xbt/log_large_test "--log=root.fmt:%m%n" --cd ${CMAKE_BINARY_DIR}/teshsuite/) ADD_TEST(memcheck-xbt-log-parallel-0 ${CMAKE_BINARY_DIR}/teshsuite/xbt/parallel_log_crashtest "--log=root.fmt:%m%n" --cd ${CMAKE_BINARY_DIR}/teshsuite/) -ADD_TEST(memcheck-xbt-mmalloc-0 ${CMAKE_BINARY_DIR}/teshsuite/xbt/mmalloc_test --log=root.fmt:%m%n --cd ${CMAKE_BINARY_DIR}/teshsuite/) +IF(${ARCH_32_BITS}) + ADD_TEST(memcheck-xbt-mmalloc-32-0 ${CMAKE_BINARY_DIR}/teshsuite/xbt/mmalloc_test --log=root.fmt:%m%n --cd ${CMAKE_BINARY_DIR}/teshsuite/) +ELSE(${ARCH_32_BITS}) + ADD_TEST(memcheck-xbt-mmalloc-64-0 ${CMAKE_BINARY_DIR}/teshsuite/xbt/mmalloc_test --log=root.fmt:%m%n --cd ${CMAKE_BINARY_DIR}/teshsuite/) +ENDIF(${ARCH_32_BITS}) # teshsuite/gras/datadesc directory ADD_TEST(memcheck-tesh-gras-dd-mem-0 ${CMAKE_BINARY_DIR}/teshsuite/gras/datadesc/datadesc_usage --copy "--log=root.fmt:%m%n" --cd ${CMAKE_BINARY_DIR}/teshsuite/) diff --git a/teshsuite/xbt/mmalloc_32.tesh b/teshsuite/xbt/mmalloc_32.tesh new file mode 100644 index 0000000000..e7b3f09f19 --- /dev/null +++ b/teshsuite/xbt/mmalloc_32.tesh @@ -0,0 +1,109 @@ +$ ./xbt/mmalloc_test --log=root.fmt:%m%n +> Allocating a new heap +> HeapA allocated +> 100 bytes allocated with offset 175000 +> 200 bytes allocated with offset 176000 +> 300 bytes allocated with offset 177000 +> 400 bytes allocated with offset 177200 +> 500 bytes allocated with offset 177400 +> 600 bytes allocated with offset 178000 +> 700 bytes allocated with offset 178400 +> 800 bytes allocated with offset 178800 +> 900 bytes allocated with offset 178c00 +> 1000 bytes allocated with offset 179000 +> 1100 bytes allocated with offset 17a000 +> 1200 bytes allocated with offset 17a800 +> 1300 bytes allocated with offset 17b000 +> 1400 bytes allocated with offset 17b800 +> 1500 bytes allocated with offset 17c000 +> 1600 bytes allocated with offset 17c800 +> 1700 bytes allocated with offset 17d000 +> 1800 bytes allocated with offset 17d800 +> 1900 bytes allocated with offset 17e000 +> 2000 bytes allocated with offset 17e800 +> 2100 bytes allocated with offset 17f000 +> 2200 bytes allocated with offset 180000 +> 2300 bytes allocated with offset 181000 +> 2400 bytes allocated with offset 182000 +> 2500 bytes allocated with offset 183000 +> 2600 bytes allocated with offset 184000 +> 2700 bytes allocated with offset 185000 +> 2800 bytes allocated with offset 186000 +> 2900 bytes allocated with offset 187000 +> 3000 bytes allocated with offset 188000 +> 3100 bytes allocated with offset 189000 +> 3200 bytes allocated with offset 18a000 +> 3300 bytes allocated with offset 18b000 +> 3400 bytes allocated with offset 18c000 +> 3500 bytes allocated with offset 18d000 +> 3600 bytes allocated with offset 18e000 +> 3700 bytes allocated with offset 18f000 +> 3800 bytes allocated with offset 190000 +> 3900 bytes allocated with offset 191000 +> 4000 bytes allocated with offset 192000 +> 4100 bytes allocated with offset 193000 +> 4200 bytes allocated with offset 195000 +> 4300 bytes allocated with offset 197000 +> 4400 bytes allocated with offset 199000 +> 4500 bytes allocated with offset 19b000 +> 4600 bytes allocated with offset 19d000 +> 4700 bytes allocated with offset 19f000 +> 4800 bytes allocated with offset 1a1000 +> 4900 bytes allocated with offset 1a3000 +> 5000 bytes allocated with offset 1a5000 +> 100 bytes allocated with offset 175080 +> 200 bytes allocated with offset 176100 +> 300 bytes allocated with offset 177600 +> 400 bytes allocated with offset 177800 +> 500 bytes allocated with offset 177a00 +> 600 bytes allocated with offset 179400 +> 700 bytes allocated with offset 179800 +> 800 bytes allocated with offset 179c00 +> 900 bytes allocated with offset 1a7000 +> 1000 bytes allocated with offset 1a7400 +> 1100 bytes allocated with offset 1a8000 +> 1200 bytes allocated with offset 1a8800 +> 1300 bytes allocated with offset 1a9000 +> 1400 bytes allocated with offset 1a9800 +> 1500 bytes allocated with offset 1aa000 +> 1600 bytes allocated with offset 1aa800 +> 1700 bytes allocated with offset 1ab000 +> 1800 bytes allocated with offset 1ab800 +> 1900 bytes allocated with offset 1ac000 +> 2000 bytes allocated with offset 1ac800 +> 2100 bytes allocated with offset 1ad000 +> 2200 bytes allocated with offset 1ae000 +> 2300 bytes allocated with offset 1af000 +> 2400 bytes allocated with offset 1b0000 +> 2500 bytes allocated with offset 1b1000 +> 2600 bytes allocated with offset 1b2000 +> 2700 bytes allocated with offset 1b3000 +> 2800 bytes allocated with offset 1b4000 +> 2900 bytes allocated with offset 1b5000 +> 3000 bytes allocated with offset 1b6000 +> 3100 bytes allocated with offset 1b7000 +> 3200 bytes allocated with offset 1b8000 +> 3300 bytes allocated with offset 1b9000 +> 3400 bytes allocated with offset 1ba000 +> 3500 bytes allocated with offset 1bb000 +> 3600 bytes allocated with offset 1bc000 +> 3700 bytes allocated with offset 1bd000 +> 3800 bytes allocated with offset 1be000 +> 3900 bytes allocated with offset 1bf000 +> 4000 bytes allocated with offset 1c0000 +> 4100 bytes allocated with offset 1c1000 +> 4200 bytes allocated with offset 1c3000 +> 4300 bytes allocated with offset 1c5000 +> 4400 bytes allocated with offset 1c7000 +> 4500 bytes allocated with offset 1c9000 +> 4600 bytes allocated with offset 1cb000 +> 4700 bytes allocated with offset 1cd000 +> 4800 bytes allocated with offset 1cf000 +> 4900 bytes allocated with offset 1d1000 +> 5000 bytes allocated with offset 1d3000 +> All blocks were correctly allocated. Free every second block +> Memset every second block to zero (yeah, they are not currently allocated :) +> Re-allocate every second block +> free all blocks (each one twice, to check that double free are correctly catched) +> free again all blocks (to really check that double free are correctly catched) +> Damnit, I cannot break mmalloc this time. That's SO disappointing. diff --git a/teshsuite/xbt/mmalloc.tesh b/teshsuite/xbt/mmalloc_64.tesh similarity index 100% rename from teshsuite/xbt/mmalloc.tesh rename to teshsuite/xbt/mmalloc_64.tesh -- 2.20.1