[erlang-questions] Trunkated stacktrace

Robert Raschke rtrlists@REDACTED
Tue Nov 1 19:15:17 CET 2016


Personally, I interpret deep stacktraces to be a result of frameworkitis or
poorly factored code, as something to avoid or fix. But that's probably an
unpopular opinion to have these days.

Cheers,
Robby

On 1 Nov 2016 17:09, "Vans S" <vans_163@REDACTED> wrote:

> Increase the stack trace depth. 8 is default.  No serious drawbacks I can
> think of. Indeed 8 is often too little.
>
> On Tuesday, November 1, 2016 11:25 AM, Håkan Mattsson <hm@REDACTED>
> wrote:
>
>
>
> Hi,
>
> Anybody who knows why the stacktrace returned by process_info(Pid,
> current_stacktrace) is truncated to 8 items? Is it due to some performance
> consideration?
>
>
> 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
> b/otp/erts/emulator/beam/erl_bif_info.c
> index d7f1e2d..2dc310f 100755
> --- a/otp/erts/emulator/beam/erl_bif_info.c
> +++ b/otp/erts/emulator/beam/erl_bif_info.c
> @@ -1607,7 +1607,7 @@ current_stacktrace(Process* p, Process* rp, Eterm**
> hpp)
>      Eterm mfa;
>      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;
>
>
> /Håkan
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161101/2e63f199/attachment.htm>


More information about the erlang-questions mailing list