From 2b7c256b5a692af5d4628d702dbb4f1eefe587c1 Mon Sep 17 00:00:00 2001 From: Project contributor Date: Tue, 24 Nov 2026 13:08:21 +0000 Subject: [PATCH] docs(runtime): clarify remote current_stacktrace limitation Document that self queries read the current compact stack, innermost first. Warn that remote queries return saved exception traces that can be empty or stale. --- FEATURES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/FEATURES.md b/FEATURES.md index c74bbd5..a985fc4 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -274,6 +274,14 @@ process_info items supported: `registered_name`, `message_queue_len`, `group_leader` (stored leader, inherited on spawn), `priority` (`normal` or `low`). Unknown items raise `badarg`; a dead pid returns `undefined`. +`current_stacktrace` limitation: `process_info(self(), current_stacktrace)` +reads the caller's current compact call stack, innermost frame first. For another +live process, `process_info(Pid, current_stacktrace)` instead reads the target's +saved exception trace, not its live call stack as on BEAM. The result can be +`[]` (the trace is cleared when an exception is caught or the process resumes +from a receive) or a stale exception trace. Do not use remote `current_stacktrace` +to diagnose where a process is currently running or waiting. + ### io module | Function | Status |