Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:59111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81046 invoked from network); 21 Mar 2012 08:03:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Mar 2012 08:03:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=osama.sorour@eformations.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=osama.sorour@eformations.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain eformations.net from 74.125.83.42 cause and error) X-PHP-List-Original-Sender: osama.sorour@eformations.net X-Host-Fingerprint: 74.125.83.42 mail-ee0-f42.google.com Received: from [74.125.83.42] ([74.125.83.42:46474] helo=mail-ee0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/41-07903-96B896F4 for ; Wed, 21 Mar 2012 03:03:54 -0500 Received: by eekb57 with SMTP id b57so221633eek.29 for ; Wed, 21 Mar 2012 01:03:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=8fDaXuV9NAlKf8PwiWEBzEPtPCfpyMVe+nG35X3c7wM=; b=nGO/rp1+k0EGlmUw9aAyoEmpG9ZGcMjwslVkaNBgaXMXE3u9XZ7gL5ZaDSESOTNbAP 3XpLoq9ddbsLx9kIaXGdu+mBrSda+uGggqdxJD2JEwfMZLwmxmVq+29bg9I1juFKsGD2 hTNTebPLI2YVGNb80W/CD4sH/WdRxqdZrHHrYKCCFASha/wgDUgdnX2F2gnXYCnFWFl4 SGHOgfRII2gmrh7WfTC7HDON5AauLOgoKJQduWhPGgFIfX7T0gBis1tMXUNUO5akv2Xf Oq4QY3WRSHwYdIrL7nn3Sm3mfJ86Hkshb3LRpzp4/iLkBG8GJH+9IQya5ZMusuvfuqEr IH5w== Received: by 10.14.95.129 with SMTP id p1mr399214eef.38.1332317030560; Wed, 21 Mar 2012 01:03:50 -0700 (PDT) Received: from [192.168.0.138] ([196.202.61.162]) by mx.google.com with ESMTPS id d54sm3158288eei.9.2012.03.21.01.03.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 01:03:49 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <1332272639.2383.692.camel@guybrush> Date: Wed, 21 Mar 2012 10:03:46 +0200 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <1BE14D30-B091-49B3-ACD3-4296C3C6E35B@eformations.net> References: <11302143-55E0-48E9-AC30-943E6075E794@eformations.net> <1332272639.2383.692.camel@guybrush> To: =?iso-8859-1?Q?Johannes_Schl=FCter?= X-Mailer: Apple Mail (2.1257) X-Gm-Message-State: ALoCoQnSqLVgBCYl6cQpDxV2/O2TCQcM3yO/oVc61KqT1oUIbInpkNEInW+JKtVZ36eEZxupmJEJ Subject: Re: [PHP-DEV] [PATCH] readline extension bug fixes and enhancements From: osama.sorour@eformations.net (Osama Abu Elsorour) Hello On Mar 20, 2012, at 9:43 PM, Johannes Schl=FCter wrote: >=20 > Have you read Nikita's and my comments on your mail from last week? >=20 I just did. There was a problem with my mailing list subscription = (wasn't confirmed) so I thought it didn't go through. But the good thing = is that I had ported it to 5.4 and found the memory corruption bug. Here are my answers to your comments: On Mar 14, 2012, at 10:28 PM, Johannes Schl=FCter wrote: > A) for licensing reasons we should try to keep as few readline only = things as possible in there (gpl vs. php license) I understand the issue of licensing but the extension already has = readline-specific functionality so I thought why not. However if this is = going to be a problem then I can take out all readline-sepcific = functions into a separate module altogether and keep this one for = editline functions only. > B) thread safty isn't an issue for readline but you still should do = the init and deinit in rinit/rshutdown not minit/mshutdown, probably = also do only bind_key_functions =3DNULL in rinit and init the hashtable = on demand later. Roger that. > C) don't compare the r result of zend_hash_find and others against -1 = or such but use SUCCESS/FAILURE Roger that. > D) i don't really like new features in 5.3 anymore at this stage This last patch is ported to 5.4. > E) please log a bug and attach the patch so we can track this Roger that. After I clear out which direction to take based on your = answers. And as for Nikita's comments: On Mar 14, 2012, at 10:47 PM, Nikita Popov wrote: > May I ask where you got this pattern for copying zvals from? Is this > kind of code shown in some tutorial / manual / etc? Such code is used > all other the place, instead of the MAKE_COPY_ZVAL macro and I wonder > why. Doing manual copying has a good chance of leaking memory. Just > from glancing I'd say that your code will leak if arg has a refcount > > 1 (but I could be wrong) as it does not PINIT the zval after it was > copied. Two points here: A) The new patch does not use this at all because it really isn't needed B) I got this from the same readline.c file lines 521 and 574 and 579. = But I will change it accordingly