Remove `AVM_PRINT_PROCESS_CRASH_DUMPS`

Open
#2,050 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, erlang

Research direction

Start by reading PRs #1799 and #2049 to understand the existing crash dump workaround and the failure case. Then trace how globalcontext stores and uses the logger PID and where system_flag handles system_logger; the issue gives no file or test names. Done means an alive logger suppresses context_dump() at runtime, while the default behavior uses avm_context_dump when no logger is configured.

Written by the indexing model from the issue text.

Description

PR #1799 introduced AVM_PRINT_PROCESS_CRASH_DUMPS since "The OTP relies on the logger to print information about abruptly terminated processes, and so we try to do in Popcorn, thus we need to disable the crash dumps.".
That PR was a reasonable workaround however it introduces an additional option that can be configured only at build time. Also if a crash happens without having a logger enabled, processes (or even the VM) terminates without any explaination (see PR #2049).

A different approach should be investigated: globalcontext should remember the logger PID, so if there is an alive logger, crash dumps are never printed using context_dump(). This basically makes AVM_PRINT_PROCESS_CRASH_DUMPS behavior configurable at runtime.

This can be done with system_flag(system_logger, logger | undefined | pid()) -> logger | undefined | pid(). In AtomVM will use avm_context_dump as a default.

Dominant language
Erlang
Stars
2.3k
Forks
171
Avg merge
4d 11h
Merged PRs (30d)
20

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from atomvm/AtomVM

All issues in atomvm/AtomVM

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.