php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27775 Using session_start() simultaneous causes script to crash
Submitted: 2004-03-30 08:23 UTC Modified: 2004-04-07 08:46 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: mattias at pfeiffer dot dk Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.4 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mattias at pfeiffer dot dk
New email:
PHP Version: OS:

 

 [2004-03-30 08:23 UTC] mattias at pfeiffer dot dk
Description:
------------
I'm experiencing a problem using session_start() simultaneous - ie. in 2
iframes.

An example:
    I have a page with to iframes embedded. Frame 1 runs a script with a
while(true), and at line 1 a session_start().

    A page is loaded into Frame 2, with session_start() as the only content. (Except for <?php and ?> of course)

The page in Frame 2 will not be parsed unless the session_start() is removed
from the top.

It seems as when 2 pages are loaded/loading and executing
session_start() simultaneous, PHP will fail to interpret one of them.

I've tested and determined this issue at two self-contained systems.

===================================
System information:
PHP: 2.4.3
Apache: 1.3.29

Configured with:

'../configure' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=php' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--enable-memory-limit' '--disable-debug' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--disable-xml' '--with-expat-dir=/usr' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-exec-dir=/usr/lib/php4/libexec' '--disable-static' '--with-curl=shared,/usr' '--with-dom=shared,/usr' '--with-dom-xslt=shared,/usr' '--with-dom-exslt=shared,/usr' '--with-zlib-dir=/usr' '--with-gd=shared,/usr' '--enable-gd-native-ttf' '--with-jpeg-dir=shared,/usr' '--with-xpm-dir=shared,/usr/X11R6' '--with-png-dir=shared,/usr' '--with-freetype-dir=shared,/usr' '--with-imap=shared,/usr' '--with-imap-ssl' '--with-ldap=shared,/usr' '--with-mcal=shared,/usr' '--with-mhash=shared,/usr' '--with-mm' '--with-mysql=shared,/usr' '--with-unixODBC=shared,/usr' '--with-recode=shared,/usr' '--enable-xslt=shared' '--with-xslt-sablot=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-sybase-ct=shared,/usr' '--with-ttf=shared,/usr' '--with-t1lib=shared,/usr' 


Reproduce code:
---------------
I've put up an example:

http://home.madd.dk/phptest/

Expected result:
----------------
I've expected frameA to produce desired output "HEST", but it seems like frameA.php fails to be parsed.

Actual result:
--------------
See "Expected result"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-05 09:17 UTC] mattias at pfeiffer dot dk
I've tried using latest CVS snapshot version as well as PHP5.0RC1. I am still experiencing the same problem.

I imagine it could be PHP having an open file-pointer to the session-file until the end of the script or execution of . Since the scripts at frameB.php runs a while(true) (or similar) the file-pointer will not be closed, and when frameA.php tries to open the session-file it fails.
 [2004-04-07 08:46 UTC] sniper@php.net
Given the fact that there is no actual _crash_ anywhere, you just need to read about this:

http://www.php.net/manual/en/function.session-write-close.php

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 22:01:33 2024 UTC