From 1143c915c4c29f20d6202c3ec10ebbf04a567c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 12 Oct 2017 20:55:52 +0200 Subject: Document the guarantees provided by get_stacktrace --- erts/doc/src/erlang.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml index b40aae5d28..d0588fe3c1 100644 --- a/erts/doc/src/erlang.xml +++ b/erts/doc/src/erlang.xml @@ -2029,6 +2029,18 @@ helper() -> where the exception occurred or the function was called. +

Developers should rely on stacktrace entries only for + debugging purposes.

+

The VM performs tail call optimization, which + does not add new entries to the stacktrace, and also limits stacktraces + to a certain depth. Furthermore, compiler options, optimizations and + future changes may add or remove stacktrace entries, causing any code + that expects the stacktrace to be in a certain order or contain specific + items to fail.

+

The only exception to this rule is error:undef which + guarantees to include the Module, Function and Arity + of the attempted function as the first stacktrace entry.

+

See also error/1 and error/2.

-- cgit v1.2.3