php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32862 session_register() causes Segmentation fault
Submitted: 2005-04-28 02:22 UTC Modified: 2005-05-01 00:14 UTC
From: svenl at haberer-online dot de Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.11 OS: SUSE Linux 9.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: svenl at haberer-online dot de
New email:
PHP Version: OS:

 

 [2005-04-28 02:22 UTC] svenl at haberer-online dot de
Description:
------------
Hi,

when calling session_register() using php 4.3.11 and apache 2.0.50, I get an Seg-Fault.

When using $_SESSION, it works fine

Using php 4.3.10 and exactly the same configuration, it worked fine.

my config looks as follows:
 ./configure --prefix=/usr --datadir=/usr/share/php --mandir=/usr/share/man --bindir=/usr/bin --libdir=/usr/share --includedir=/usr/include --sysconfdir=/etc --with-_lib=lib --with-config-file-path=/etc --with-exec-dir=/usr/lib/php/bin --disable-debug --enable-inline-optimization --enable-memory-limit --enable-magic-quotes --enable-safe-mode --enable-sigchild --disable-ctype --disable-session --without-mysql --disable-cli --without-pear --with-openssl --with-apxs2=/usr/sbin/apxs2-prefork i586-suse-linux --with-unixODBC=/usr/lib/unixODBC  

php-ini:
register_globals = On


Reproduce code:
---------------
Script 1: crashes

<?
	$barney = "A big purple dinosaur.";
	session_register("barney");
        echo "date=".date("H:i:s",time());
?>

Script 2: works

<?
	$_SESSION["barney"] = "A big purple dinosaur.";
        echo "date=".date("H:i:s",time());
?>

Expected result:
----------------
both times I expect the time to be displayed

Actual result:
--------------
With the first script the browser shows nothing (FireFox) or complains that the server closed the connection (Konqueror). 

Also apache adds the following warning to the error_log:
[date] [notice] child pid 30727 exit signal Segmentation fault (11)

---

The second script shows the time as expected

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-28 02:32 UTC] svenl at haberer-online dot de
Actually the same problem exists if 
register_globals = Off
 [2005-04-28 08:28 UTC] sniper@php.net
It can hardly work if you have '--disable-session' in your configure line. 
 [2005-04-30 23:13 UTC] svenl at haberer-online dot de
Hi Sniper, 
 
thanX for your quick reply...  
 
Sorry about not mentioning this earlier, but my 
session-support is inside an extension... 
 
Thus using exactly the same configure command for 4.3.10, 
sessions work fine (with register_globals = On, obviously). 
 
Perhaps the output of php_info helps: 
www.haberer-online.de/php/php4_3_10_info.htm 
www.haberer-online.de/php/php4_3_11_info.htm 
 
These are the two programs I use for testing: 
 
/// snip : session_test.php // 
<? 
	$barney = "A big purple dinosaur."; 
	session_register("barney"); 
	echo "date=".date("H:i:s",time()); 
?> 
<br><a href="session_test2.php">Next</a> 
//// end session_test.php // 
 
/// snip : session_test2.php // 
<? 
	session_register("barney"); 
	echo $barney."<br>"; 
	echo "date=".date("H:i:s",time()); 
?> 
//// end session_test2.php // 
 
with version 4.3.10, no errors get reported and the value 
set in the first script is reported in the second script... 
 
With v 4.3.11 I get the mentioned error messages. 
 
BTW, the only things I did was  
configure 
make 
make install  
- the extensions were not touched. Might there be some 
incompatibility ? 
 
The content of my extension dir looks like: 
ikarus: # pwd 
/usr/lib/php/extensions 
ikarus: # ll 
total 320 
drwxr-xr-x  2 root root   224 Mar 20 23:00 . 
drwxr-xr-x  5 root root   160 Mar 20 23:39 .. 
-rwxr-xr-x  1 root root 15426 Oct  5  2004 bz2.so 
-rwxr-xr-x  1 root root 36096 Oct  5  2004 curl.so 
-rwxr-xr-x  1 root root 43584 Oct  5  2004 ftp.so 
-rwxr-xr-x  1 root root 93311 Oct  5  2004 gd.so 
-rwxr-xr-x  1 root root 49578 Oct  5  2004 mysql.so 
-rwxr-xr-x  1 root root 52726 Oct  5  2004 session.so 
-rwxr-xr-x  1 root root 28486 Oct  5  2004 zlib.so 
 
ThanX again for your assistance - hope its not a stupid 
mistake from my side... 
 
Sven
 [2005-04-30 23:27 UTC] tony2001@php.net
>Might there be some incompatibility ? 

Yes, of course.
Where did you get that extensions compiled with one PHP version will work with another one?
 [2005-05-01 00:14 UTC] svenl at haberer-online dot de
Hi Tony,

was just assuming these would work through minor revisons, as all my programs run fine when upgrading from original-suse PHP to my own re-compile of php 4.3.10 (to enable ODBC-support)... 
The extensions are original as from SUSE 9.2 Pro.

And when upgrading to 4.3.11, I noted that session support was broken - assuming there would be a problem in this php version...

Now I checked all extensions (using the demo-pograms from php-doc):

- "bz2" causes a seg-fault for both 4.3.10+11
- "curl" works for both 4.3.10+11
- "ftp" works for both 4.3.10+11
- "gd" works for both 4.3.10+11
- "mysql" works for both 4.3.10+11
- "session" causes a seg-fault for 4.3.11 only
- "zlib" works for both 4.3.10+11

Thus I if I understand you you correctly, I will have to re-compile all extensions for every upgrade in version ?

ThanX,
Sven
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 10:01:28 2024 UTC