Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103311 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 45030 invoked from network); 9 Oct 2018 12:45:19 -0000 Received: from unknown (HELO mail-io1-f44.google.com) (209.85.166.44) by pb1.pair.com with SMTP; 9 Oct 2018 12:45:19 -0000 Received: by mail-io1-f44.google.com with SMTP id n5-v6so577184ioh.5 for ; Tue, 09 Oct 2018 01:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eTLzTSEvyUAbTgZTWBLyfE76e5q3AJo4QgCsbzXLYU8=; b=cciYJnLkE2DI3YwmwCBJd8Viqq1TYe5uIn3ddIUe5DNpwmBFY5csucUDIabqArx7DK 9Z/lm2nmYrMrZvro5QQZh0p/8HVs9swGI2P9JxdnhoGT9BCG5LxxqQy3EHt642JSJerw jKDMFjq84p7l2B/4F0et4jNs9WODUMMszgnwKZsLTzomwHwlNFJMkSeCf8DFBa39+wjP zfa4qwD7wPP1oYYXp/U8E4JAf4xegvry8/P/lS1bVPE447Ar0r47O9uX3p+2jOA7xNLz qmkdNq/58PMydv8GIJ7tXXMdY82H+0OBvIaWcJiBZWTnkv2jsX49/hC2TcKdH+iFX5/v jiNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eTLzTSEvyUAbTgZTWBLyfE76e5q3AJo4QgCsbzXLYU8=; b=kein2tPH2ZRx8t2u4Ip2JMGMs0/X/jwXlqrPNBSlq80AZnnNR/D/YSU8Sl713U6+25 lfhQwRChFBv4bB6zRKg7B3hVcPB71zbTedy7dwkNFDJIIkZAM3dRhdO+8/V3+Is1TY0d r3KDfKFd5bJvASMj85Y7SZ6Focn5zSs6Y+/3f4D6pEpGFOUNd7bG6dqgcuCqoqbq9V3r WD3gP4N6EXb3uxLPheQ434W67IoQGPVvIU2+hsBPEe8MfbKz3OkPREcUTxaa3n56WyF8 PGqXfvjPQVqxp01xhSfNY3l7ynfrHMOX4msr9j647H8rH72iOo8bBZCCI7G1um2TCbz9 2QkQ== X-Gm-Message-State: ABuFfoidsC15KfIOd3ED0c/yVd/7ITY/MmpN7RNCbkyMju1ZECK7QF85 oeK0j3jEQ7IBsM2EMy8ePa5Be2YgfNo9R/c4sIw= X-Google-Smtp-Source: ACcGV63CWVMPeFoMBXYhg99JwivVmProifEC2706HZlxqYKEBOPym0mHex5W0+j32ZXdd1SgiDv+1XeZT0a3CSlS32c= X-Received: by 2002:a5e:df0d:: with SMTP id f13-v6mr16952179ioq.235.1539075398816; Tue, 09 Oct 2018 01:56:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 9 Oct 2018 09:56:27 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006dd7820577c7ea11" Subject: Re: [PHP-DEV] die('zend_mm_heap corrupted'); // TODO: Better error message From: rowan.collins@gmail.com (Rowan Collins) --0000000000006dd7820577c7ea11 Content-Type: text/plain; charset="UTF-8" On Tue, 9 Oct 2018 at 07:16, Dmitry Stogov wrote: > Hi Rowan, > > > This error message is triggered when Zend MM used in improper way, e.g. > invalid pointer free, etc. > > MM can't provide useful information about the context and reason. > I get that it can't provide the *reason*, but that doesn't mean there can't be any *context*: - Will it always occur during shutdown? If so, the message could include "during shutdown". If not, could the message indicate whether it is or not? - The ZEND_MM_CHECK macro takes a message, but all 15 uses of it pass the same message, "zend_mm_heap corrupted"; are they really identical? Could making each message distinct help improve bug reports? - The printf format in zend_mm_panic could add something other than a newline, e.g. "PHP Engine Error: %s", to make this line clearer in the logs to people who have never heard of "Zend MM". - Ideally, it would also include a timestamp; without this, it can be very hard to line up which requests are failing, or even how often it is happening. So, rather than the current message: zend_mm_heap corrupted It would be great to see: [09-Oct-2018 09:33:03 Europe/London] PHP Fatal Error: zend_mm_heap corrupted (invalid page offset) during process shutdown. Even better would be for this to drop into the PHP error log, rather than echoing to stderr, but I realise that might be more complicated during a "panic" scenario like this. > The best way to find the reason of the problem is running php under > valgrind. > > > $ USE_ZEND_ALLOC=0 valgrind php ... > > > In most cases valgrind will show incorrect MM operations and their history. > I'm not proficient enough with C to get far with that, so my main concerns are 1) ensuring these errors are clearly visible in the logs; and 2) helping provide useful context in a bug report against core or an extension. Regards, -- Rowan Collins [IMSoP] --0000000000006dd7820577c7ea11--