aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-03-30 17:02:05 +0200
committerSverker Eriksson <[email protected]>2015-03-30 17:05:23 +0200
commitda14897a6363a5c39180e8e3edf0c1c8336cfeb5 (patch)
treea9de8df74466fe9c33ab78100b2aaad4ff70765f /erts/emulator/beam/erl_bif_info.c
parentaa13ab92a4bc99bffdb1576690d1b62be8d34e4a (diff)
downloadotp-da14897a6363a5c39180e8e3edf0c1c8336cfeb5.tar.gz
otp-da14897a6363a5c39180e8e3edf0c1c8336cfeb5.tar.bz2
otp-da14897a6363a5c39180e8e3edf0c1c8336cfeb5.zip
erts: Suppress valgrind for bif_SUITE:erlang_halt
which does a deliberate deref of null pointer which is caught by a SEGV signal handler to resume crash dumping.
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r--erts/emulator/beam/erl_bif_info.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index b2658a1fd6..fa7de23f00 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -3747,6 +3747,20 @@ BIF_RETTYPE erts_internal_is_system_process_1(BIF_ALIST_1)
static erts_smp_atomic_t hipe_test_reschedule_flag;
+#if defined(VALGRIND) && defined(__GNUC__)
+/* Force noinline for valgrind suppression */
+static void broken_halt_test(Eterm bif_arg_2) __attribute__((noinline));
+#endif
+
+static void broken_halt_test(Eterm bif_arg_2)
+{
+ /* Ugly ugly code used by bif_SUITE:erlang_halt/1 */
+#if defined(ERTS_HAVE_TRY_CATCH)
+ erts_get_scheduler_data()->run_queue = NULL;
+#endif
+ erl_exit(ERTS_DUMP_EXIT, "%T", bif_arg_2);
+}
+
BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
{
@@ -4040,11 +4054,7 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
}
}
else if (ERTS_IS_ATOM_STR("broken_halt", BIF_ARG_1)) {
- /* Ugly ugly code used by bif_SUITE:erlang_halt/1 */
-#if defined(ERTS_HAVE_TRY_CATCH)
- erts_get_scheduler_data()->run_queue = NULL;
-#endif
- erl_exit(ERTS_DUMP_EXIT, "%T", BIF_ARG_2);
+ broken_halt_test(BIF_ARG_2);
}
else if (ERTS_IS_ATOM_STR("unique_monotonic_integer_state", BIF_ARG_1)) {
int res = erts_debug_set_unique_monotonic_integer_state(BIF_ARG_2);