Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89891 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40181 invoked from network); 26 Dec 2015 05:01:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Dec 2015 05:01:29 -0000 Authentication-Results: pb1.pair.com header.from=akin.ocal@thomsonreuters.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=akin.ocal@thomsonreuters.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain thomsonreuters.com from 163.231.6.26 cause and error) X-PHP-List-Original-Sender: akin.ocal@thomsonreuters.com X-Host-Fingerprint: 163.231.6.26 mailout2-trp.thomsonreuters.com Received: from [163.231.6.26] ([163.231.6.26:28769] helo=mailout2-trp.thomsonreuters.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/F4-51216-52F1E765 for ; Sat, 26 Dec 2015 00:01:26 -0500 Received: from trpusmneagrly02.int.westgroup.com (relay2 [163.231.22.113]) by mailout2-trp.thomsonreuters.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id tBQ51M5U007564 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sat, 26 Dec 2015 05:01:22 GMT Received: from EAGE-ERFPHUB12.ERF.thomson.com (EAGE-ERFPHUB12.erf.thomson.com [10.220.31.97]) by trpusmneagrly02.int.westgroup.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id tBQ51Mga032050 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Sat, 26 Dec 2015 05:01:22 GMT Received: from C111NTDEMBX52.ERF.thomson.com ([fe80::258d:aef3:9aa7:4f92]) by EAGE-ERFPHUB12.ERF.thomson.com ([fe80::fd21:37:dee1:80cb%12]) with mapi id 14.03.0158.001; Fri, 25 Dec 2015 23:01:21 -0600 To: Thread-Topic: PHP7 Zend Heap validation Thread-Index: AdE/mnNUaZoe7ARCTPOj22hNRWSX6A== Date: Sat, 26 Dec 2015 05:01:21 +0000 Message-ID: <291D5EE7BC9867498082E6D9A81BA0D504C124EE@C111NTDEMBX52.ERF.thomson.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.30.4] x-tm-as-product-ver: SMEX-11.0.0.4179-7.500.1018-22022.006 x-tm-as-result: No--44.386600-0.000000-31 x-tm-as-user-approved-sender: Yes x-tm-as-user-blocked-sender: No Content-Type: multipart/alternative; boundary="_000_291D5EE7BC9867498082E6D9A81BA0D504C124EEC111NTDEMBX52ER_" MIME-Version: 1.0 Subject: PHP7 Zend Heap validation From: akin.ocal@thomsonreuters.com --_000_291D5EE7BC9867498082E6D9A81BA0D504C124EEC111NTDEMBX52ER_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi everyone, I am working on porting a pre-PHP7 database driver extension to PHP7 for Wi= ndows platforms. ( I am using PHP 7.0.1 master branch code and targeting non-ZTS 32 bit PHP7= on Windows Server 2012 R2 ) And currently as I did mechanical bits of porting ( compilation issues, get= ting functionality working mostly followed https://wiki.php.net/phpng-upgrading ) , my extension is on= ly crash-free if I run it with USE_ZEND_ALLOC=3D0. However with USE_ZEND_ALLOC=3D1 , I am getting crashes inside zend_mm_alloc= _small. As checked with Windbg : ... if (EXPECTED(heap->free_slot[bin_num] !=3D NULL) ) { zend_mm_free_slot *p =3D heap->free_slot[bi= n_num]; if ( p->next_free_slot !=3D NULL ) Above , p->next_free_slot is not readable. I believe , currently I am getti= ng the Zend heap corrupt. I am running a test script and I tried disabling many things ,and enabling= one by one to have an idea, from the looks of it , I am getting this issue around a zend_register_resource call but to me that one looks legitimate so= I can`t easily pinpoint where the Zend heap gets corrupt. Diffrently from pre-PHP7 where we had full_mem_check , now I can see ZEND_M= M_CHECK is placed in memory manager functions. I wanted to ask if there is any chance if we can have a heap integrity chec= ker function , or what would you advise regarding to track down the places in our code corrupting the Zend MM ? Regards, Akin Ocal ________________________________ This e-mail is for the sole use of the intended recipient and contains info= rmation that may be privileged and/or confidential. If you are not an inten= ded recipient, please notify the sender by return e-mail and delete this e-= mail and any attachments. Certain required legal entity disclosures can be = accessed on our website. --_000_291D5EE7BC9867498082E6D9A81BA0D504C124EEC111NTDEMBX52ER_--