Bug #51382 [Com]: session_start() blocks execution

[email protected] ("abca_b_cabcom at hotmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=51382&edit=1

 ID:               51382
 Comment by:       abca_b_cabcom at hotmail dot com
 Reported by:      info at lategoodbye dot de
 Summary:          session_start() blocks execution
 Status:           Open
 Type:             Bug
 Package:          Session related
 Operating System: Linux 2.4.35.4 mips
 PHP Version:      5.3.2

 New Comment:

Maybe you can post your backtrace result here first, i just guess it is
a compiler error, cause php_combined_lcg function should have no error.


Previous Comments:
------------------------------------------------------------------------
[2010-03-25 15:11:53] info at lategoodbye dot de

May be i expressed myself bad about the option session.gc_divisor.
Setting the option to 100000 is nearly like disabling garbage
collection. The chance to reproduce the problem is very, very low but
possible.

How can i findout that it's a compile error?

Nevertheless i will make the backtrace.

------------------------------------------------------------------------
[2010-03-25 08:47:54] abca_b_cabcom at hotmail dot com

From you description I traced back to the line 1475 in
./etc/session/session.c,
it is the only line which will be affect by the php.ini variable
session.gc_divisor you describe.

The line is show below:
nrand = (int) ((float) PS(gc_divisor) * php_combined_lcg(TSRMLS_C));

So, I think it may be a compiling error.

------------------------------------------------------------------------
[2010-03-24 19:04:24] [email protected]

One way to figure that out is to attach gdb to a hanging fcgi process
and get a 
backtrace (bt) from gdb which should show where it is stuck.

------------------------------------------------------------------------
[2010-03-24 18:44:22] info at lategoodbye dot de

Description:
------------
Hi, i'm running PHP 5.3.2 via FastCGI with lighttpd 1.4.25 and uclibc
0.9.29. I experienced that after a period of time, all session driven
pages hang and deliver no content to the client. But all static content
like images are accessible. Below i appended a little script, how the
problem can be reproduced.

Here are the options from the php.ini:

session.save_handler = files
session.save_path = "/tmp"
session.gc_probability = 1
session.gc_divisor     = 100
session.gc_maxlifetime = 1440

Here is the configure line:

'./configure' '--target=mipsel-linux' '--host=mipsel-linux'
'--build=i486-linux-gnu' '--program-prefix=' '--program-suffix='
'--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc'
'--datadir=/usr/share' '--localstatedir=/var' '--mandir=/usr/man'
'--infodir=/usr/info' '--disable-nls' '--enable-shared'
'--disable-static' '--disable-rpath' '--disable-debug' '--without-pear'
'--with-config-file-path=/etc' '--enable-magic-quotes'
'--disable-short-tags' '--without-gettext' '--disable-simplexml'
'--with-zlib=/home/10_openwrt/staging_dir/mipsel/usr'
'--with-zlib-dir=/home/10_openwrt/staging_dir/mipsel/usr'
'--with-pcre-regex=/home/10_openwrt/staging_dir/mipsel/usr'
'--disable-phar' '--enable-ctype=shared' '--without-curl'
'--disable-fileinfo' '--disable-dom' '--disable-exif' '--disable-ftp'
'--without-gd' '--without-gmp' '--disable-hash' '--without-iconv'
'--enable-json=shared' '--without-ldap' '--disable-mbstring'
'--without-mcrypt' '--without-mysql' '--without-openssl'
'--enable-pdo=shared' '--without-pdo-mysql' '--without-pdo-pgsql'
'--with-pdo-sqlite=shared,/home/10_openwrt/staging_dir/mipsel/usr'
'--without-pgsql' '--enable-session=shared' '--disable-soap'
'--enable-sockets=shared' '--without-sqlite'
'--with-sqlite3=shared,/home/10_openwrt/staging_dir/mipsel/usr'
'--disable-tokenizer'
'--enable-xml=shared,/home/10_openwrt/staging_dir/mipsel/usr'
'--with-libexpat-dir=/home/10_openwrt/staging_dir/mipsel/usr'
'--disable-xmlreader' '--disable-xmlwriter' '--disable-apc'
'--disable-filter' '--disable-libxml' '--enable-sysvsem'
'--enable-sysvshm' '--enable-sysvmsg' '--enable-pcntl' '--disable-cli'
'--enable-cgi'

The filesystem behind /tmp is tmpfs.

After that i played a little bit with option session.gc_divisor. If i
set the option to 2, then the problem happend immediately. But if i set
the option to 100000, the problem is not reproducable.

Is this a dead lock caused by the session garbage collector?

Test script:
---------------
<?php
session_start();
session_write_close();  
?>
<html><body>Content</body></html>

Expected result:
----------------
PHP delivers "Content" to the browser.

Actual result:
--------------
The browser didn't get "Content" and wait for a response.


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



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51382&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.