From 92fc37555fd74b9a3848c956df49a516906af711 Mon Sep 17 00:00:00 2001 From: Kevin Adler Date: Fri, 13 Nov 2020 15:30:51 -0600 Subject: Fix test crashes on AIX Both hash_collision_bench and manifest_parser_perftest crash on AIX with terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc IOT/Abort trap (core dumped) 32-bit AIX applications by default allocates only a single 256M segment for stack and heap for 32-bit applications, which is insufficient for these tests. When building these tests on AIX in 32-bit mode, increase the max number of segments so they will run without crashing. --- CMakeLists.txt | 6 ++++++ configure.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cf6006..7009214 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,12 @@ if(BUILD_TESTING) target_link_libraries(${perftest} PRIVATE libninja libninja-re2c) endforeach() + if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND CMAKE_SIZEOF_VOID_P EQUAL 4) + # These tests require more memory than will fit in the standard AIX shared stack/heap (256M) + target_link_libraries(hash_collision_bench PRIVATE "-Wl,-bmaxdata:0x80000000") + target_link_libraries(manifest_parser_perftest PRIVATE "-Wl,-bmaxdata:0x80000000") + endif() + add_test(NinjaTest ninja_test) endif() diff --git a/configure.py b/configure.py index 48c4821..cded265 100755 --- a/configure.py +++ b/configure.py @@ -596,6 +596,11 @@ all_targets += ninja_test n.comment('Ancillary executables.') +if platform.is_aix() and '-maix64' not in ldflags: + # Both hash_collision_bench and manifest_parser_perftest require more + # memory than will fit in the standard 32-bit AIX shared stack/heap (256M) + libs.append('-Wl,-bmaxdata:0x80000000') + for name in ['build_log_perftest', 'canon_perftest', 'depfile_parser_perftest', -- cgit v0.12