#47640 [Fbk->Opn]: Session does not close file in /tmp/

From: Date: Sun, 15 Mar 2009 11:24:15 +0000
Subject: #47640 [Fbk->Opn]: Session does not close file in /tmp/
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-134711@lists.php.net to get a copy of this message
 ID:               47640
 User updated by:  manuel dot schmitt at manitu dot de
 Reported By:      manuel dot schmitt at manitu dot de
-Status:           Feedback
+Status:           Open
 Bug Type:         Session related
 Operating System: Linux
 PHP Version:      5.2.9
 New Comment:

The most simple script at all

<?php
session_start();
?>

can cause the problem, please take my notes I posted before into
attention.


Previous Comments:
------------------------------------------------------------------------

[2009-03-13 13:26:21] jani@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2009-03-13 10:06:52] manuel dot schmitt at manitu dot de

Description:
------------
PHP internal session handler does not correctly closes flock()s on
session files

Reproduce code:
---------------
(This bug seems the same issue as bug #32092)

The problem happens on various PHP applications, no matter what they do
exactly. Only one same thing: They are all using PHP sessions.

In these cases Apache/PHP-processes hanging forever (until killed). I
have strace'd the processed, they are hanging on flock()ing the session
file as

   flock(FILE_ID, LOCK_EX, <unfinished>)

where FILE_ID is a /tmp/sess_XXX-File (not on NFS, just local) [I have
traced this from /proc/PROCID/fd/FILE_ID which links to the session
file]

I suppose that there was an php process flock()ing the file, perhaps
running into max_execution_time, not unflocking the session file
correctly and other processed wanting to write session data.


Expected result:
----------------
PHP session handler should have some timeout and/or old file locks
should be hard-broken.

Actual result:
--------------
Forever-Hanging php processes.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47640&edit=1



Thread (22 messages)

« previous php.bugs (#134711) next »