-
Notifications
You must be signed in to change notification settings - Fork 144
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.