From 6605b3965064a3edce1260e6d77fba55817844b5 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 4 Jul 2019 15:33:14 +0200 Subject: [esock|test] Add conditional skip to debug test case The api_m_debug test case seems to trigger a gcc bug that causes a segfault on an ancient Fedora 16 VM (with gcc version 4.6.3-2). The simplest way to avoid this is to test for this specific (gcc) version... OTP-15817 --- erts/emulator/test/socket_SUITE.erl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/erts/emulator/test/socket_SUITE.erl b/erts/emulator/test/socket_SUITE.erl index 3a45339ce1..d51e7fa464 100644 --- a/erts/emulator/test/socket_SUITE.erl +++ b/erts/emulator/test/socket_SUITE.erl @@ -1664,10 +1664,34 @@ api_m_debug(doc) -> api_m_debug(_Config) when is_list(_Config) -> ?TT(?SECS(5)), tc_try(api_m_debug, + fun() -> has_bugfree_gcc() end, fun() -> ok = api_m_debug() end). +%% For some reason this test case triggers a gcc bug, which causes +%% a segfault, on an ancient Fedora 16 VM. So, check the version of gcc... +%% Not pretty, but the simplest way to skip (without actually testing for the host). +has_bugfree_gcc() -> + has_bugfree_gcc(os:type()). + +%% Make sure we are on linux +has_bugfree_gcc({unix, linux}) -> + has_bugfree_gcc2(os:cmd("cat /etc/issue")); +has_bugfree_gcc(_) -> + ok. + +%% Make sure we are on Fedora 16 +has_bugfree_gcc2("Fedora release 16 " ++ _) -> + has_bugfree_gcc3(os:cmd("gcc --version")); +has_bugfree_gcc2(_) -> + ok. + +has_bugfree_gcc3("gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2" ++ _) -> + skip("Buggy GCC"); +has_bugfree_gcc3(_) -> + ok. + api_m_debug() -> i("get initial info"), #{debug := D0} = socket:info(), -- cgit v1.2.3