OOM when backtrace args include a large object

Created on 24 January 2023, almost 2 years ago

Problem/Motivation

_drupal_error_handler_real() calls debug_backtrace() and dumps it into _drupal_log_error(). When it gets to Monolog, Monolog tries to json_encode() it, and if there's an object in there, you can run out of memory. We ended up with a 500 error in production because of a deprecation notice whose debug_backtrace() included a ViewExecutable.

Proposed resolution

Either remove the backtrace entirely, or make it depend on a setting or an environment variable, so it doesn't end up in production logs.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ksenzee Washington state

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ksenzee
  • πŸ‡ΊπŸ‡ΈUnited States ksenzee Washington state

    When I tried patching this against the dev version, I found my patch doesn't apply - I'm not sure if I'm on an old or patched version already. I'll close this at least for now.

Production build 0.71.5 2024