php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14628 Session functions block on lock
Submitted: 2001-12-20 12:40 UTC Modified: 2002-07-21 01:00 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: chris at kinexus dot net Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.1.0 OS: Linux
Private report: No CVE-ID: None
 [2001-12-20 12:40 UTC] chris at kinexus dot net
When running php with fastcgi, php gets stuck on call to open session file. Strace output gives following;

open("/www/external/sessions/sess_7cd8fc3921075f6f1483f052619e44e8",O_RDWR) = 4
flock(4, LOCK_EX

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-20 19:00 UTC] yohgaki@php.net
Could you try 4.1.0 and/or 4.2.0-dev see if it's fixed?
http://www.php.net/downloads.php (4.1.0)
http://snaps.php.net/ (4.2.0-dev)

Please report the result and update PHP version.

--
Yasuo Ohgaki

 [2001-12-21 11:11 UTC] chris at kinexus dot net
Hi

Have installed 4.1, same problem as highlighted below:
[root@fweb2 /root]# strace -p 6739
flock(4, LOCK_EX


[root@fweb2 /root]# lsof | grep sessions
php        6739 fonetastic    4u   REG      72,10       163    294275 /www/external/sessions/sess_104bb2ffcc67af16af4095cbd92a8f64
php        6949 fonetastic    4u   REG      72,10       163    294275 /www/external/sessions/sess_104bb2ffcc67af16af4095cbd92a8f64
 [2001-12-21 20:27 UTC] yohgaki@php.net
Do you have frames with your php script?
If yes, write session_write_close() to see if it helps.
I don't have time to check mod_files.c now, just trying to find work around ;)

PHP version 4.0.6 => 4.1.0
 [2001-12-22 06:12 UTC] chris at kinexus dot net
Hi

No Frames involved.  Thanks 

Chris

 [2002-01-06 20:17 UTC] yohgaki@php.net
I guess your httpd is crashing. Please check your apache log. Do you get core file?


 [2002-01-07 05:38 UTC] chris at kinexus dot net
Hi

We are not running apache. We are runnig zeus with php running as a fastcgi responder.  At the moment, I am running a script which checks the state of the fastcgi/php processes and kill sany if locked on opening session file for more than 30 seconds.

Thanks


 [2002-02-03 19:46 UTC] yohgaki@php.net
This may be fixed my patch
 [2002-03-06 02:51 UTC] yohgaki@php.net
This bug has been fixed in CVS.

Since I've changed my patch a little. I'm not sure if it really fixed or not.
If you still have this problem, please reopen. 
 [2002-06-18 04:10 UTC] hholzgra@php.net
does it work wit latest CVS now?

 [2002-06-19 12:30 UTC] chris at kinexus dot net
I have tried this using 4.1.2, and the problem is still occuring.  As soon as we are in a position to test 4.2, i will advise.
 [2002-06-19 13:13 UTC] derick@php.net
Leaving this with status feedback then.
 [2002-07-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-07-28 18:34 UTC] x dot torello at bpa dot ad
Hi,

I'm experiencing the same problem using a compiled PHP 5.2.13 over an Apache 2.2.15.

The main problem is to reproduce the scenario that blocks the session file, as I can see seems aleatory; and just affects one of the php webapps hosted in this Apache.

Have you solved this issue? I tried to force a session_write_close to flush all lock processes, but I get the same result.

To not pause the development of this project I implemented a bash script that kills the apache thread that blocks the session, but it's just a temporal patch...

Any feedback would be great!

Thanks in advance.
--
X
 [2011-02-22 11:42 UTC] s dot lazzaris at interactive dot eu
I see the very same behaviour, but I'm running nginx with php spawned by spawn-fcgi.

I'm running php 5.3.5, spawn-fcgi 1.6.3 on arch linux.

I only use this machine for development; I start 5 php processes and after some inactivity, the processes hangs and the fastcgi interface is frozen.
Strace shows 2 processes blocked on flock(4, LOCK_EX

I guess that this is connected to the php session handling.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC