From 7c9ea890cd2530bffeafa82abeeee876fd24a6ba Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 23 Aug 2017 12:29:50 +0200 Subject: erts: Allow any unicode string as crash dump slogan i.e the first argument to erlang:halt --- erts/emulator/beam/bif.c | 2 +- erts/emulator/test/bif_SUITE.erl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'erts/emulator') diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 8bf7e3926e..4c92b9ba2b 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -4020,7 +4020,7 @@ BIF_RETTYPE halt_2(BIF_ALIST_2) erts_smp_proc_unlock(BIF_P, ERTS_PROC_LOCK_MAIN); erts_exit(ERTS_ABORT_EXIT, ""); } - else if (is_string(BIF_ARG_1) || BIF_ARG_1 == NIL) { + else if (is_list(BIF_ARG_1) || BIF_ARG_1 == NIL) { # define HALT_MSG_SIZE 200 static byte halt_msg[4*HALT_MSG_SIZE+1]; Sint written; diff --git a/erts/emulator/test/bif_SUITE.erl b/erts/emulator/test/bif_SUITE.erl index 339c827602..4908ac410c 100644 --- a/erts/emulator/test/bif_SUITE.erl +++ b/erts/emulator/test/bif_SUITE.erl @@ -691,6 +691,9 @@ erlang_halt(Config) when is_list(Config) -> {badrpc,nodedown} = rpc:call(N3, erlang, halt, [0,[]]), {ok,N4} = slave:start(H, halt_node4), {badrpc,nodedown} = rpc:call(N4, erlang, halt, [lists:duplicate(300,$x)]), + %% Test unicode slogan + {ok,N4} = slave:start(H, halt_node4), + {badrpc,nodedown} = rpc:call(N4, erlang, halt, [[339,338,254,230,198,295,167,223,32,12507,12531,12480]]), % This test triggers a segfault when dumping a crash dump % to make sure that we can handle it properly. -- cgit v1.2.3