Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71782 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58280 invoked from network); 30 Jan 2014 07:18:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jan 2014 07:18:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.182 mail-lb0-f182.google.com Received: from [209.85.217.182] ([209.85.217.182:41865] helo=mail-lb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/43-42724-1DCF9E25 for ; Thu, 30 Jan 2014 02:18:42 -0500 Received: by mail-lb0-f182.google.com with SMTP id w7so2278169lbi.27 for ; Wed, 29 Jan 2014 23:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=KqiFQHAnGD/edT8Jx7CfNEU1lRddEXSObHBm3lavl4I=; b=XD0uLxkogRbYxtYNJO1Mwc0ikhpP6MwCQtuWU/QTugfiT04OVknK2nBP0Vdq2DIfYi mtFBgUYZnfiO0zC2YbbPBnNMTloLufB5IfVrBYPBBveRC0NHZSt/Rojg2H0WB/NxZaFr ZAXHqdykjdG5T05bL4Sh44/ygDcu4izLYNjTzRm4bDnCIoUdaoDwNixCmTFdMIs9pw4A ApFcGxeoeBOPKiFE3Ba3FcudGdhd9JVJAeMOC3C+1+xCYGCcAoHl0zFOWAJjUCG1fVtq IR+rrWX4xveGuiCIDAzs3TQZsfM6UBMuwl6t40Ke1q4bnIO8oJXdPM0ejE9ftWBdqSS4 ijog== X-Received: by 10.112.14.1 with SMTP id l1mr238226lbc.39.1391066319006; Wed, 29 Jan 2014 23:18:39 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 29 Jan 2014 23:17:58 -0800 (PST) In-Reply-To: References: <52E9A631.5050808@sugarcrm.com> <18069656.FoN8fZuO6C@rofl> Date: Thu, 30 Jan 2014 16:17:58 +0900 X-Google-Sender-Auth: Q3T6YLsLhBU0vqux1uNukFe-fr0 Message-ID: To: Patrick Schaaf Cc: internals Content-Type: multipart/alternative; boundary=001a11c3733ecdb10f04f12add4f Subject: Re: [PHP-DEV] Re: [VOTE] Introduce session.lock, session.lazy_write and session.lazy_destory From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3733ecdb10f04f12add4f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Patrick, On Thu, Jan 30, 2014 at 3:37 PM, Patrick Schaaf wrote: > Unrelated to the previous discussion, and applicable to the base PHP code > in mod_files.c too, another observation: > > Some syscalls can fail with EINTR, when a signal hits while within the > kernel. This is especially true for flock(LOCK_EX) because in the > already-locked case the second call will go to sleep for a while waiting > for the lock to clear. But it is also possible, I think, for the > pread/read/write calls. The usual handling for the case (-1 return && err= no > =3D=3D EINTR) is to just repeat the call in a while loop. I think that at= least > doing so for the LOCK_EX calls, would be prudent. > > best regards > I also notice other issue when closely looking at current code. It does open() =E2=86=93 read() - locked =E2=86=93 script execution =E2=86=93 write() - unlock =E2=86=93 close() However, when write() is called, it always close opened fd to address changed session ID. This logic will likely to create race condition that reads old session data before writing. I'll address this issue as other issue to be fixed. In short, session data access is not serialized like serializable transaction isolation level. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3733ecdb10f04f12add4f--