php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6341 floating point exception on session.c
Submitted: 2000-08-24 19:35 UTC Modified: 2001-01-08 16:44 UTC
From: goten at mylaptop dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.0.1pl2 OS: FreeBSD 4.1 stable
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: goten at mylaptop dot com
New email:
PHP Version: OS:

 

 [2000-08-24 19:35 UTC] goten at mylaptop dot com
Configuation :

./configure  --with-mysql=/usr/local/mysql 
--with-apxs=/usr/local/apache/bin/apxs 
--with-config-file-path=/usr/local/etc 
--with-gd=/usr/local --with-pcre-regex=/usr/local --enable-track-vars

using stock php.ini except session.auto_start        = 1  


Got the following error when I run gdb on PHP 4.01pl2/FreeBSD 4.1 stable system.  The script have session used.  Apache will most likely crash when there are syntax errors or parsing errors in the script.  Keep pressing reload button can also crash Apache sometimes.


Program received signal SIGFPE, Arithmetic exception.
---Type <return> to continue, or q <return> to quit---
0x2834bc77 in _php_session_start () at session.c:853
853                        nrand = (int) (100.0*rand()/RAND_MAX);
(gdb) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-03 05:51 UTC] stas@php.net
Does this still happen on 4.0.2?
 [2000-09-04 04:29 UTC] goten at mylaptop dot com
Yes, it still happen in 4.02.  When session is enable, and there are parsing or syntax error in the code, apache will exit on signal 8.  It is not happen everytime, but if you keep reloading on the same page, it crash 2 out of 5 times.
 [2000-11-21 04:19 UTC] sniper@php.net
I use sessions a lot and have never experienced this..not
at least after PHP 4.0.3pl1. Could you try the latest
snapshot from http://snaps.php.net/ and report back
whether these crashes are gone?

--Jani
 [2000-11-30 15:44 UTC] goten at mylaptop dot com
take a look at 
http://www.hkgonline.net/test.php?pid=1&tid=1&mode=threaded&order=0&myTopic=Main&op=ShowComment#1

Please use Netscape because it give you a better view what the problem is.  Once you go to that page, just keep pressing reload button on netscape.  Once a while you will get a error message says "This document contained no data.  Try again later, or contact the server's administrator.".  Whenever this message pop up, a error message "[notice] child pid 65569 exit signal Floating point exception (8)" will appear in httpd error log file.

This test.php file have an intentional error in the scripts.  It try to call a function that is not defined.  It should display the error message "Fatal error: Call to undefined function: cdbconnect() in /usr2/home/business/hkonline/www/test.php on line 245" if the server does not crash.
 [2000-11-30 15:57 UTC] goten at mylaptop dot com
Ok, I got a more simple code to reproduce the error.  This is the code for test3.php

<?php

   echo "a";
   cdbconnect();   //call to a function did not define



?>

go to http://www.hkgonline.net/test3.php using netscape.  You will get that No data error once a while if you keep pressing reload button.
 [2000-11-30 17:03 UTC] goten at mylaptop dot com
Ok, I got a more simple code to reproduce the error.  This is the code for test3.php

<?php

   echo "a";
   cdbconnect();   //call to a function did not define



?>

go to http://www.hkgonline.net/test3.php using netscape.  You will get that No data error once a while if you keep pressing reload button.
 [2000-11-30 19:49 UTC] goten at mylaptop dot com
Ok, I found out the problem.  Whenever I use --with-gd, it will crash like that.  As long as I don't use --with-gd, it works fine.  I am using the gd-1.8.3(newest port) for FreeBSD.
 [2000-11-30 19:56 UTC] goten at mylaptop dot com
I think You can try to install the PHP 4.03pl1 in your test FreeBSD system with the flag --with-gd, and see if it does the same error as mine.  Here is the config I use

./configure  --with-mysql=/usr/local/mysql 
--with-apxs=/usr/local/apache/bin/apxs 
--with-config-file-path=/usr/local/etc 
--with-gd=/usr/local --with-pcre-regex=/usr/local --enable-track-vars


If you can find a fix for it.  Please let me know.  Thanks
 [2000-12-01 15:23 UTC] goten at mylaptop dot com
Here is two link you can try.

This one use --without-gd flag
http://www.hkgonline.net/test3.php

This one use --with-gd flag
http://www.hkgonline.net:8080/test3.php

Just go to each of the link and keep pressing reload button using netscape.  You will see the port 8080 one crash from time to time.  I use FreeBSD GD-1.8.3 port from http://www.freebsd.org/cgi/ports.cgi?query=gd-1.8.3&stype=all


Source code for test3.php is 

<?php

   echo "a";
   cdbconnect();   //call to a function did not define



?>

 [2000-12-03 19:03 UTC] sniper@php.net
Could you please try getting a gdb backtrace of that crash?
And have you tried the snapshot yet???

--Jani

 [2000-12-04 14:02 UTC] goten at mylaptop dot com
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...(no debugging symbols found)...
(gdb) run -f /usr/local/apache1/conf/httpd.conf -X
Starting program: /usr/local/apache1/bin/httpd -f /usr/local/apache1/conf/httpd.conf -X
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...
Program received signal SIGFPE, Arithmetic exception.
0x2821f913 in php_session_start () at session.c:924
924                     nrand = (int) (100.0*rand()/RAND_MAX);
 [2000-12-04 14:08 UTC] goten at mylaptop dot com
(gdb) bt
#0  0x2821f913 in php_session_start () at session.c:924
#1  0x28220e32 in php_rinit_session (type=1, module_number=3) at session.c:1387
#2  0x281ee0a3 in module_registry_request_startup (module=0x813fcc0)
    at zend_API.c:838
#3  0x281f0ff3 in zend_hash_apply (ht=0x282d9c80, 
    apply_func=0x281ee078 <module_registry_request_startup>) at zend_hash.c:692
#4  0x281ed2ab in zend_activate_modules () at zend.c:490
#5  0x281fcbdf in php_execute_script (primary_file=0xbfbff700) at main.c:1137
#6  0x281f97f4 in apache_php_module_main (r=0x815f034, display_source_mode=0)
    at sapi_apache.c:89
#7  0x281fa15b in send_php (r=0x815f034, display_source_mode=0, filename=0x0)
    at mod_php4.c:510
#8  0x281fa19a in send_parsed_php (r=0x815f034) at mod_php4.c:521
#9  0x8054981 in ap_invoke_handler ()
#10 0x80692fc in process_request_internal ()
#11 0x8069366 in ap_process_request ()
#12 0x806050f in child_main ()
#13 0x80606ed in make_child ()
#14 0x8060866 in startup_children ()
#15 0x8060e74 in standalone_main ()
#16 0x80616a4 in main ()
#17 0x804f399 in _start ()
 [2000-12-08 01:16 UTC] goten at mylaptop dot com
As of 12/7, it still happen in the latest snap shot.
 [2000-12-13 13:21 UTC] goten at mylaptop dot com
[root{509}]# gdb /usr/local/apache1/bin/httpd
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...(no debugging symbols found)...
(gdb) run -f /usr/local/apache1/conf/httpd.conf -X
Starting program: /usr/local/apache1/bin/httpd -f /usr/local/apache1/conf/httpd.conf -X
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...
Program received signal SIGFPE, Arithmetic exception.
0x28220eff in php_session_start () at session.c:966
966                     nrand = (int) (100.0*rand()/RAND_MAX);
(gdb) bt
#0  0x28220eff in php_session_start () at session.c:966
#1  0x2822244a in php_rinit_session (type=1, module_number=3) at session.c:1442
#2  0x281ef9ab in module_registry_request_startup (module=0x8135fc0)
    at zend_API.c:838
#3  0x281f2937 in zend_hash_apply (ht=0x282de460, 
    apply_func=0x281ef980 <module_registry_request_startup>) at zend_hash.c:692
#4  0x281eebb3 in zend_activate_modules () at zend.c:502
#5  0x281ff6b9 in php_request_startup () at main.c:646
#6  0x281fcf15 in apache_php_module_main (r=0x8155034, display_source_mode=0)
    at sapi_apache.c:66
#7  0x281fd8e7 in send_php (r=0x8155034, display_source_mode=0, filename=0x0)
    at mod_php4.c:503
#8  0x281fd926 in send_parsed_php (r=0x8155034) at mod_php4.c:514
#9  0x8054981 in ap_invoke_handler ()
#10 0x80692fc in process_request_internal ()
#11 0x8069366 in ap_process_request ()
#12 0x806050f in child_main ()
#13 0x80606ed in make_child ()
#14 0x8060866 in startup_children ()
#15 0x8060e74 in standalone_main ()
#16 0x80616a4 in main ()
#17 0x804f399 in _start ()
(gdb) c
Continuing.

Program terminated with signal SIGFPE, Arithmetic exception.
The program no longer exists.
(gdb) 
 [2000-12-21 10:37 UTC] kalowsky@php.net
I spent some time this morning looking into this bug and have been unable to reproduce it.  I was able to crash the Netscape browser multiple times over though...take that for what you will.  I am also unable to access your 8080 sample page unfortunately.

uname -a
FreeBSD CatchallServer.tics35.eng.tvol.net 4.2-STABLE FreeBSD 4.2-STABLE #5: Tue Nov 21 08:22:09 EST 2000     root@CatchallServer.tics35.eng.tvol.net:/usr/src/sys/compile/SERVER  i386

CatchallServer# pkg_info | grep gd
gd-1.8.3            A graphics library for fast PNG creation

CatchallServer# pkg_info | grep apache
apache+mod_ssl-1.3.14+2.7.1_1 The Apache 1.3 webserver with 
                              SSL/TLS functionality
apache-1.3.14       The extremely popular Apache http 
                    server.  Very fast, very c


I do not use mysql nor do I use the pcre-regex config lines.
Excerpt from local phpinfo:

System    FreeBSD intern6.eng.tvol.net 4.2-RELEASE FreeBSD
          4.2-RELEASE #25: Tue Nov 21 08:29:37 EST 2000

Build Date    Dec 11 2000

Configure Command
'./configure' '--with-imap' '--with-pgsql' '--with-gettext'
              '--enable-snmp''--enable-track-vars'
              '--enable-wddx' '--with-gd=/usr/local'
              '--enable-trans-sid' '--disable-magic-quotes'
              '--enable-short-tags' '--without-mysql'
              '--with-apxs=/usr/local/sbin/apxs'
              '--without-tsrm-pthreads' 
              '--prefix=/suproot/usr/local'

I'm currently bringing down a more recent version of PHP to try this with again.

This has also been tested on a machine build with the same config file under XFree864.0.2, for which PHP seems to require some of the truetype fonts when built with gd (??).  Again, the provided sample file cannot seem to crash the apache server.  Again the machine is a FreeBSD 4.2-STABLE system.

 
 [2000-12-21 13:12 UTC] goten at mylaptop dot com
The URL http://www.hkgonline.net:8080/test3.php is avaiable again.  Please let me know if you experience the same error as your configuration.  Thanks.
 [2000-12-21 13:20 UTC] goten at mylaptop dot com
This is the error I got from kern.log

Dec 22 02:19:45 central pid 474 (httpd), uid 65534: exited on signal 8
Dec 22 02:20:05 central pid 475 (httpd), uid 65534: exited on signal 8
Dec 22 02:20:19 central pid 476 (httpd), uid 65534: exited on signal 8
 [2000-12-21 13:53 UTC] goten at mylaptop dot com
This is the error I got from kern.log

Dec 22 02:19:45 central pid 474 (httpd), uid 65534: exited on signal 8
Dec 22 02:20:05 central pid 475 (httpd), uid 65534: exited on signal 8
Dec 22 02:20:19 central pid 476 (httpd), uid 65534: exited on signal 8
 [2000-12-22 15:38 UTC] kalowsky@php.net
Once again, I was unable to reproduce this locally.   The provided URL does indeed seem to cause instant data loss though...

What does seem to be at issue here may be the same issue Sascha has discussed in an email on the php-dev list entitle "FPEs on FreeBSD" where another report has been filed on this.  FreeBSD 4.1-STABLE is identified as having this problem.

 [2000-12-22 17:58 UTC] sas@php.net
Does that still happen, if you change

fpsetmask(mask & ~FP_X_IMP);

to

fpsetmask(0);

in Zend/zend.c (around line 339)?
 [2000-12-27 19:41 UTC] goten at mylaptop dot com
I tried on php-4.0.4 with the fix

fpsetmask(mask & ~FP_X_IMP);

to

fpsetmask(0);


The problem is stil there.  I ran configure as 

./configure  --without-mysql  --with-apxs=/usr/local/apache1/bin/apxs  --with-config-file-path=/usr/local/etc --enable-track-vars  --with-gd=/usr/local

Even without mysql, as long as --with-gd is there, the problem still exist.
 [2000-12-28 15:54 UTC] goten at mylaptop dot com
After playing with the configuration for a couple days, I finally figure out what cause the problem.  When I configure --with-gd=/usr/local, the configure rountine did not find the libjpg and png installed.  But the configure routine still install the GD option in PHP.  That's what cause the apache keep crashing on the test page.  I have to manually specify --with-jpeg-dir=/usr/local and --with-xpm-dir=/usr/X11R6.  

So, now the question is:
1.  Why the configuration routine still install GD while libjpg and png can not be found, even libjpg and png is required by GD.
2.  Why would that cause the apache to crash even no GD function is using?
 [2001-01-05 23:11 UTC] sniper@php.net
1. There is no way of knowing with which libraries GD was built with.
 That's why there  are these --with-jpeg-dir options.
2. Of course it crashes on startup if some undefined symbols are found.
3. One bug per report.

--Jani
 [2001-01-08 16:44 UTC] goten at mylaptop dot com
I would assume if the configuration file did not find the required files for GD, and --with-gd is specify, the configuration script will stopped.  Wouldn't make it more clear?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 15:01:30 2024 UTC