Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99620 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19810 invoked from network); 22 Jun 2017 21:15:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2017 21:15:14 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.67 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.67 mail-it0-f67.google.com Received: from [209.85.214.67] ([209.85.214.67:33248] helo=mail-it0-f67.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/97-52620-0633C495 for ; Thu, 22 Jun 2017 17:15:13 -0400 Received: by mail-it0-f67.google.com with SMTP id x12so4612650itb.0 for ; Thu, 22 Jun 2017 14:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FoDPcnKvIhywcAVFI58QmNWkgxCDVFmSTdcs6AID1Fs=; b=GOD3UIymZ28j0cn5UCJb1d6vinLH9zvanLgagrD3Rwj1nuB2Pj2SEzclLR6LCseqGj idgfM/FNzxpK/I6Zw3Wc75p+W91vLqPE07ba2cm7ZsPWMx85XZXzT9ZdzsUDBjxTcwH4 kIj2S1ZnaOF4MdFBGAB5jUximkTyqCAhK26bD/UXJuupmknNxG7qQ9SfKXtq+7uIuBZy zUKBtQvE8et2YACwn+nppxCZyvMN+YpbG9Lkb0efC1nx+CowU5IsZ1GJEQy2f+wYAJxj 0jucPEbjda8h/+cWk/I/mU0OqmHTHPzKvtjmNGZPsQoP0CaVlvE+ekYKf0uIbD01FYKJ 5Ulw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FoDPcnKvIhywcAVFI58QmNWkgxCDVFmSTdcs6AID1Fs=; b=DT6Tchu3C8FUQ96mkVP80qAPZg8Kl/as5rnwjJCqEjUxkBAwmL51iTkjoKfHXI0J4N mk/zsSDvX9rtqEsKYTI4IMaTQGvfOFRIBEYOWoFIAqR/5cNlgYqxgc0qYALaXVdKlysN 0x01AnOxk6vvo2So/GY1h3gbWhgH6Pt4Nu7LetctWeWEBQubJI/xYkJFTozO6flrByFL 4LoTTwEaqIC5MgR4JPHcoieh6ud9tyq/UfiA7kequnGNExsIzrl8ULFnZ+jwWdC/IGTq Ypw3CjckjyjCj7jUv+hI5d/rT+4VSPX2Ab2OaS2U2+bqp4KxBz+ryupEv8GODRRcDZxH Pb+A== X-Gm-Message-State: AKS2vOy6jU17ZCzP8eNVdL0mJoVNJxfvuEYnZL0YWqkR3R5YNDFR31Pk kVwfUh8pN/t+Z0wgIF+umKR898zHtQtl X-Received: by 10.36.2.133 with SMTP id 127mr4141348itu.21.1498166110230; Thu, 22 Jun 2017 14:15:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.33.134 with HTTP; Thu, 22 Jun 2017 14:15:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Jun 2017 23:15:09 +0200 Message-ID: To: Jakub Zelenka Cc: Dmitry Stogov , PHP internals list Content-Type: multipart/alternative; boundary="001a1143dd16d0c641055292fab5" Subject: Re: [PHP-DEV] Valgrind failures From: nikita.ppv@gmail.com (Nikita Popov) --001a1143dd16d0c641055292fab5 Content-Type: text/plain; charset="UTF-8" On Thu, Jun 22, 2017 at 9:12 PM, Jakub Zelenka wrote: > Ah thanks I see! Just out of interest what changes actually caused it as > it's master only? > It's due to https://github.com/php/php-src/commit/141d1ba9801f742dc5d9ccd06e02b94284c4deb7, which has only been introduced in master. Nikita > On Thu, Jun 22, 2017 at 7:51 PM, Nikita Popov > wrote: > >> On Thu, Jun 22, 2017 at 8:45 PM, Jakub Zelenka wrote: >> >>> Hi Dmitry, >>> >>> I noticed that valgind reports a lot of memleaks for the master and it >>> seems to be related to the freeing of registered classes on shutdown when >>> running cli. I'm wondering if it can be related to your recent changes >>> that >>> were touching that parts. I haven't found the commit that caused but 7.1 >>> is >>> fine. If you don't think that it was related I will try to find it but >>> wanted to check with you first. >>> >>> Here is a part of the output what I'm getting when running valgrind on >>> debug build for master: >>> >>> valgrind --leak-check=full php ext/openssl/tests/openssl_dige >>> st_basic.phpt >>> ... >>> ... (simillar info like this for all loaded extensions like the below) >>> ... >>> ==4101== 648 bytes in 9 blocks are definitely lost in loss record 69 of >>> 70 >>> ==4101== at 0x4C2DB9D: malloc (vg_replace_malloc.c:299) >>> ==4101== by 0xB7DC7D: zend_register_functions (zend_API.c:2304) >>> ==4101== by 0xB7F209: do_register_internal_class (zend_API.c:2714) >>> ==4101== by 0xB7F400: zend_register_internal_class (zend_API.c:2762) >>> ==4101== by 0xB7F2BF: zend_register_internal_class_ex >>> (zend_API.c:2734) >>> ==4101== by 0x64EFAC: zm_startup_dom (php_dom.c:643) >>> ==4101== by 0xB7C211: zend_startup_module_ex (zend_API.c:1873) >>> ==4101== by 0xB7C29B: zend_startup_module_zval (zend_API.c:1888) >>> ==4101== by 0xB8B6B1: zend_hash_apply (zend_hash.c:1507) >>> ==4101== by 0xB7C907: zend_startup_modules (zend_API.c:1999) >>> ==4101== by 0xAB2E71: php_module_startup (main.c:2269) >>> ==4101== by 0xC6B159: php_cli_startup (php_cli.c:431) >>> ==4101== >>> ==4101== 5,592 bytes in 78 blocks are definitely lost in loss record 70 >>> of >>> 70 >>> ==4101== at 0x4C2DB9D: malloc (vg_replace_malloc.c:299) >>> ==4101== by 0xB7DC7D: zend_register_functions (zend_API.c:2304) >>> ==4101== by 0xB7CBB0: zend_register_module_ex (zend_API.c:2062) >>> ==4101== by 0xB7CC8B: zend_register_internal_module (zend_API.c:2077) >>> ==4101== by 0xAB242E: php_register_extensions (main.c:1996) >>> ==4101== by 0xC6A834: php_register_internal_extensions >>> (internal_functions_cli.c:114) >>> ==4101== by 0xAB2E30: php_module_startup (main.c:2253) >>> ==4101== by 0xC6B159: php_cli_startup (php_cli.c:431) >>> ==4101== by 0xC6D40D: main (php_cli.c:1362) >>> ==4101== >>> ==4101== LEAK SUMMARY: >>> ==4101== definitely lost: 9,968 bytes in 142 blocks >>> ==4101== indirectly lost: 0 bytes in 0 blocks >>> ==4101== possibly lost: 0 bytes in 0 blocks >>> ==4101== still reachable: 1,518 bytes in 30 blocks >>> ==4101== suppressed: 0 bytes in 0 blocks >>> ==4101== Reachable blocks (those to which a pointer was found) are not >>> shown. >>> ==4101== To see them, rerun with: --leak-check=full --show-leak-kinds=all >>> ==4101== >>> ==4101== For counts of detected and suppressed errors, rerun with: -v >>> ==4101== ERROR SUMMARY: 40 errors from 40 contexts (suppressed: 0 from 0) >>> >>> Please let me know! Or if anyone else has an idea about the changes that >>> caused it that would be great. >>> >>> Currently it's quite difficult to use vlagrind and find the real issues >>> though... >>> >>> Thanks >>> >>> Jakub >>> >> >> These are arginfo leaks. If arginfo contains type hints, then it is >> copied now, but not freed. There's an incomplete PR for this issue here: >> https://github.com/php/php-src/pull/2462 >> >> Nikita >> >> > --001a1143dd16d0c641055292fab5--