From:             laden100 at mail dot ru
Operating system: Solaris
PHP version:      5.2.3
PHP Bug Type:     Session related
Bug description:  Same processes of one session are executed simultaneously

Description:
------------
If more than one process of the same session is created in the one time, 
this processes are executed simultaneously instead of being executed one
after another.

Reproduce code:
---------------
<?php
 //For example this script is asked three times simultaneously from the
one user, siting on the one session ID
 require_once('db_fns.php'); //requiring mysql functions and connecting to
database
 require_once('session.php'); //creating session from MySQL storage
 $sessid = session_id();
 $example = db_query_onerow("SELECT example FROM table WHERE id=1"); //etc
the field `example` is "1" by default. So all three times every process has
the value "1"
 echo "Example: $example"; //So every time we will get "1"
 $lock = db_query_onerow("SELECT GET_LOCK('database.lock_{$sessid}',
60);"); //Getting lock to test the bug of PHP
 $anotherexample = db_query_onerow("SELECT example FROM table WHERE
id=1"); //This Select will be not executed at the one time because of MySQL
locks and will give us the right values
 echo "Another Example: $anotherexample"; //At the first time it will be
"1" and two other time "0"
 db_query_write("UPDATE table SET example=0 WHERE id=1"); //Setting the
field `example` to 0
 $lock = db_query_onerow("SELECT
RELEASE_LOCK('database.lock_{$sessid}')"); //Getting lock to test the bug
?>

Expected result:
----------------
Example: 1
Another Example: 1
Example: 0
Another Example: 0
Example: 0
Another Example: 0

Actual result:
--------------
Example: 1
Example: 1
Example: 1
Another Example: 1
Another Example: 0
Another Example: 0

-- 
Edit bug report at http://bugs.php.net/?id=41705&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41705&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41705&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41705&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41705&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41705&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41705&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41705&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41705&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41705&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41705&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41705&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41705&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41705&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41705&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41705&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41705&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41705&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41705&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41705&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41705&r=mysqlcfg

Reply via email to