[erlang-questions] Trunkated stacktrace
Tue Nov 1 16:25:05 CET 2016
Anybody who knows why the stacktrace returned by process_info(Pid,
current_stacktrace) is truncated to 8 items? Is it due to some performance
In order to get more usable stacktraces I were thinking of doing this
little fix in our system? Do you foresee any drawbacks with it?
Btw, 8 happens to be the default of the system flag backtrace_depth.
diff --git a/otp/erts/emulator/beam/erl_bif_info.c
index d7f1e2d..2dc310f 100755
@@ -1607,7 +1607,7 @@ current_stacktrace(Process* p, Process* rp, Eterm**
Eterm res = NIL;
- depth = 8;
+ depth = erts_backtrace_depth;
sz = offsetof(struct StackTrace, trace) + sizeof(BeamInstr *)*depth;
s = (struct StackTrace *) erts_alloc(ERTS_ALC_T_TMP, sz);
s->depth = 0;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions