ID: 20449 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Session related Operating System: redhat 7.3 PHP Version: 4.4.0-dev New Comment:
Further testing shows that on Windows 2000 Server with Identical Configurations as the Windows 2000 Pro (I did diffs to be sure) reveals: Win2000Server 2 Processor- 2 failues in an estimates 300,000 tests. Win2000Server 4 processor - 0 failures in 1000 tests (Just started running this one.) Basically I had everyone in the office run the test against the 2 Processor system at the same time. Only 2 failures in that many requests I can live with. So is it more of an issue on less capable systems? Previous Comments: ------------------------------------------------------------------------ [2003-01-08 01:52:58] [EMAIL PROTECTED] interesting. However, I switched my session manager to a dbase function and it still died. How would file locking effect that? I'm interested in the fact though that you can actually witness the bug first hand. I only saw that it was happening. However, I could never get the thing to happen to me. Also, since I have gone to my own session code without using php's built in sessions, I don't have problems at all anymore. Josh ------------------------------------------------------------------------ [2003-01-08 01:19:06] [EMAIL PROTECTED] My script will fail in as short as 1 request or over 1000 requests. I did set session.gc_probability = 0 but still fails. -Ryan ------------------------------------------------------------------------ [2003-01-08 01:13:53] [EMAIL PROTECTED] I CAN REPRODUCE THIS BUG!!! Sort of… I too had my software working perfectly for over a year under PHP 4.0.6 / Apache 1.3.24 on Win2000 Pro (development) Win2000 Server (production). After upgrading to PHP 4.2.3 / Apache 1.3.27 I've been pulling my hair out with this session disappearing problem. I tried just about everything I could find in the bug lists mentioned in this bug to no avail, short of trying latest CVS. I'm short on time and resources and from what I read; they haven't fixed the problem yet. As far as it being a serialization problem I don't think so. None of my session variables are more complex than a string. So I wrote a simple test and I know it's not IE specific. I could recreate the problem with IE 6, Opera 6.05, Netscape 7.0, and Mozilla 1.3 I striped the test to be as simple as 1 integer as a session variable and it would still die. I removed the counting aspect to verify it wasn't a write problem, just reading session data would kill it as well. The error seems to occur if requests are made to the session variable from different files close enough together in time to cause one to "lock" the session file while the next request tries to access it. Resulting in this error: Warning: open(c:\tmp\sess_c6bdd642a5d88639e785ec13b0d2f126, O_RDWR) failed: Permission denied (13) in c:\apache\htdocs\testing\session2.php on line 10 Obviously it DOES have permission or else my scripts would fail all the time. This does fail on all Windows servers I tested with PHP 4.2.3. I did try it on a Slackware 8.1 with PHP 4.2.1 / Apache 1.3.24 and it did NOT fail. I hope this helps track down the elusive bug so I don't have to downgrade back to 4.0.6 but I'm left with few options. I will try a CVS if you think it might fix it but I've already spent more time than I have on this. And from what I read, they don't fix it. If you need more info just ask. I'll try to do what I can. My test consists of 4 files. Obviously the comments are not part of the files. //----------------file: session0.php -------------------- // Just used to clean things up when they get ugly. //------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head><title>Session Test</title></head> <body> <pre> <?php session_start(); session_unset(); session_destroy(); print_r($_SESSION); ?> </pre> <a href="session1.php">Load Values</a> </body> </html> //----------------file: session1.php -------------------- // Sets up the session vars //------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head><title>Session Test</title></head> <body> <pre> <?php session_start(); $_SESSION['count'] = 0; $_SESSION['test_int'] = 2; $_SESSION['test_real'] = 3.5; $_SESSION['test_char'] = 'a'; $_SESSION['test_string'] = 'abc'; $ary = array(); $ary[] = 'z'; $ary[] = 'y'; $ary[] = 'x'; $_SESSION['test_array'] = $ary; print_r($_SESSION); ?> </pre> <a href="session0.php">Reset</a> <br> <a href="session2.php">Start Test in single page</a> <br> <a href="sessionFrames.php">Start Test in frames</a> </body> </html> //----------------file: session2.php -------------------- // Calls itself repeatedly, increments count //------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head><title>Session Test</title></head> <body> <pre style="font-size: 8pt;"> <?php session_start(); if (isset($_SESSION['count'])) { $_SESSION['count']++; } else { ?> <script><!-- alert("Session LOST!"); --></script> <?php } print_r($_SESSION); ?> </pre> Running... <?php if (isset($_SESSION) && isset($_SESSION['count']) && ($_SESSION['count'] > 0)) { ?> <script><!-- setTimeout("document.location.href='session2.php'", 0); --></script> <?php } else { ?> Session LOST! <?php } ?> </body> </html> //-------------file: sessionFrames.php ------------------ // Defines the frameset //------------------------------------------------------- <html> <head><title>Session Test</title></head> <frameset rows="50,50,50,50" framespacing="0" border="1" frameborder="1"> <frame name="1" src="session2.php" scrolling="no" noresize marginwidth="0" marginheight="0"> <frame name="2" src="session2.php" scrolling="no" noresize marginwidth="0" marginheight="0"> <frame name="3" src="session2.php" scrolling="no" noresize marginwidth="0" marginheight="0"> <frame name="4" src="session2.php" scrolling="no" noresize marginwidth="0" marginheight="0"> <noframes> <p>This page uses frames, but your browser doesn't support them.</p> </noframes> </frameset> </html> ------------------------------------------------------------------------ [2002-12-12 03:58:54] [EMAIL PROTECTED] After upgrading to PHP 4.2.3, I'm having the same problem with random session dataloss. Everything worked just fine before when using 4.0.6. I'm using linux kernel 2.4.9 on an Intel machine, PHP 4.2.3/Apache 1.3.27. Session data files are stored on a NFS share, standard "files" handler. ------------------------------------------------------------------------ [2002-12-10 09:36:08] [EMAIL PROTECTED] Upgraded to 4.4.0-dev and I'm still not dancing. - php.ini settings are the same. - URL's are not re-written. - Session data lossage is almost immediate. also: - I am implementing virtual hosts. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20449 -- Edit this bug report at http://bugs.php.net/?id=20449&edit=1