Re: PHP 4.0 Bug #5105 Updated: Crash in session module (Arithmetic exception)
| From: | Rasmus Lerdorf | Date: | Sun, 18 Jun 2000 00:55:04 +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-21658@lists.php.net to get a copy of this message | ||
> 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