Re: PHP 4.0 Bug #5105 Updated: Crash in session module (Arithmetic exception)

From: Date: Sun, 18 Jun 2000 04:24:44 +0000
Subject: Re: PHP 4.0 Bug #5105 Updated: Crash in session module (Arithmetic exception)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-21665@lists.php.net to get a copy of this message
I don't know how this happened but it was supposed to be fpsetmask (~FP_X_IMP). I have updated the CVS. Let us know if it helps. Also if you have time please change the code to the following and let me know if it compiles: Change the: fpsetmask(FP_X_IMP); to: {
        fp_except mask;
        mask = fpgetmask();
        fpsetmask(mask & ~FP_X_IMP);
} Thanks, Andi At 05:55 PM 6/17/00 -0700, Rasmus Lerdorf wrote:
On Sat, Jun 17, 2000 at 05:38:14PM -0700, Rasmus Lerdorf wrote:
Full Bug description available at:
http://bugs.php.net/version4/?id=5105
Yes, I just updated again, and it still crashes whenever it tries to create a session. PHP 4.0.0 works fine.
Ah, so it worked in 4.0.0 but broke later in CVS? Interesting. The change that probably affected this is this: In zend.c around line 330: #ifdef __FreeBSD__
    /* FreeBSD floating point precision fix */
    fpsetmask(FP_X_IMP);
#endif Try commenting out that fpsetmask() call to see if that is what is
causing
this.
Yes, that was the problem. It's working fine now. Hrm.. that's annoying. I don't understand why setting the fp mask to FP_X_IMP would cause a SIGFPE on that sprintf() call. That is the whole point of setting that mask. We are telling it to go ahead and lose precision on impossible casts. Not that there even is a cast here, nor even an implied cast as far as I can see. php_combined_lcg() returns a double between 0 and 1 and this value is multiplied by 10. That doesn't overflow anything. tv_sec and tv_usec are definitely longs. I must be missing something. Silly OS! -Rasmus -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#21665) next »