Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103308 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 53398 invoked from network); 8 Oct 2018 14:06:13 -0000 Received: from unknown (HELO mail-io1-f48.google.com) (209.85.166.48) by pb1.pair.com with SMTP; 8 Oct 2018 14:06:13 -0000 Received: by mail-io1-f48.google.com with SMTP id t7-v6so15387438ioj.13 for ; Mon, 08 Oct 2018 03:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=tvGd32EsdJeZUxkJyY8tTpn0q3f0AkhRINsb9f/sq2M=; b=jGuz6Ae5aX6OaIxZCG4c7XuMtrm2a0NTHBNjeGcwbo8HQCQOxmgfoxCnSLnhHuxN/H aWf4DzDtnzh9uW+mp1vvGUYbbO5AUm3AGhbNUb5LsrxUG7id0f1bYPjBCFFDXa2uf1xx BXrQtS91auoOXtNMwowcfACUreY299gP5AO9KyOrKooW4pnXHi6mRmjW+Fx0QJXhx0cB F+ENcsvh6IiMamY2KVVfyTyvxl5ebTuJJ1pUj7fSS4je7u0DPdeUJyCFM3d/Fsj5YtOC 94Pd3lGjelfHL5M5t0Jv7+41toMPPKBeaKGJXYGpAiAi4Gr/eZxqHb5I8pli2Ign02Rt 2plg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tvGd32EsdJeZUxkJyY8tTpn0q3f0AkhRINsb9f/sq2M=; b=MjAYG1VYCi8Dz/RL7ZFNGeGzB6Q0+dktQOtvGvyuyFCzxWDyieBQKylwpU58DOVfQF xQZ8cgH2uhIqQ6MP1/mGLSxOciz8h1+e/fuA0NCammbaFA2+3i5T++z6rLGAy6j7vezi Ppi14C6dUjUpT4SkPdZn7n0xu38FGisasGM9l1WLOrqnKCWT9C+QEhfA+xwg7Sihpp/I 6aZGWgJVlE4EowkYEn//3chi7z9/3uYnpq57d0P017R4POtrXCmUpfe01RysJzJj54jS wk0wwgm87Qtn4/mx/ZYRNe2v3SeP6a0x+PZ8g4Vy3uAlF/Vap5/3IOFOx1GDFOyz8uzh eUDQ== X-Gm-Message-State: ABuFfojY4LaxYOBKqZaK6esfpee3hzkIIc7LvqAcPwT7ZIJWdnhWyAj5 HqBIgaaJA63RnGY6+ZYKtp14WBtRmTIYy1f6fBoyRciG X-Google-Smtp-Source: ACcGV60kyvdXJDRklcqqQJ2yZAy5mIk1/KGPo38wHzdMbUmNp7EYJVdSGCC27yeP0rq1d+8GdgJAUKw4e8RLhE0hQSE= X-Received: by 2002:a5e:df0d:: with SMTP id f13-v6mr14197266ioq.235.1538993838220; Mon, 08 Oct 2018 03:17:18 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 8 Oct 2018 11:17:06 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="00000000000009ea7e0577b4ed8e" Subject: die('zend_mm_heap corrupted'); // TODO: Better error message From: rowan.collins@gmail.com (Rowan Collins) --00000000000009ea7e0577b4ed8e Content-Type: text/plain; charset="UTF-8" Hi all, We recently had an error in production which was hard to reproduce, hard to debug, and turned out to be a bug in an extension. One of the oddest symptoms was that the PHP code seemed to run to completion, but the request was never logged by Apache. The only thing logged was the words "zend_mm_heap corrupted", in the Apache error log. As far as I can see, this ultimately comes from zend_mm_panic [1], which (on non-Windows non-debug builds) is simply: fprintf(stderr, "%s\n", message); exit(1); Frustratingly, this error: - Doesn't contain a timestamp - Doesn't contain any context of where the error happened (not even a hint that this happened during shutdown rather than execution) - Doesn't mention PHP, or look like the messages PHP would normally log - Doesn't log to the PHP error log - Doesn't register as an error in Apache itself The server in question was running PHP as an Apache module in pre-fork mode; in that configuration, stderr gets slurped into the Apache error log without annotation, and the exit(1) silently terminates the connection and logs nothing. I suspect this is one of those last-ditch errors where there is a risk of causing further errors if global data is accessed, but is there any way this message can be improved, at least to format it more like other PHP errors? [1] https://github.com/php/php-src/blob/1154f6f70a3e4ee083f1bc42d83c190ad68f3862/Zend/zend_alloc.c#L348 Regards, -- Rowan Collins [IMSoP] --00000000000009ea7e0577b4ed8e--