#49244 [NEW]: Floating point NaN cause garbage characters
From: ronlentjes at yahoo dot com dot au
Operating system: Linux Fedora 8
PHP version: 5.3.0
PHP Bug Type: Scripting Engine problem
Bug description: Floating point NaN cause garbage characters
Description:
------------
This has been an issue since 4.2.2 and still in 5.3.0.
$d = pow (-1.0, 0.3); // or anything causing NaN
echo "$d\n";
-> NAN
printf ("%f\n", $d);
(4.2.2) -> crash
(5.2.4) -> NaN<big-box><little-box><E-with-backslash-on-top>
(5.3.0) -> NaN<hex EF BF BD><hex EF BF BD><hex EF BF BD>
(viewed in browser as NaN???)
Two issues here:
Inconsistent display of NAN for echo and NaN for printf.
Output of bogus characters after the 3 letters NaN for printf.
I think you are missing a '\0' null termination after the NaN characters
which probably cause a runaway to crash 4.2.2 but is just 'hanging' in
there for the newer versions.
Cheers,
Ron Lentjes
LC CLS.
Reproduce code:
---------------
$d = pow (-1.0, 0.3);
echo "$d\n";
printf ("%f\n", $d);
Expected result:
----------------
NaN
NaN
Actual result:
--------------
(4.2.2)
NAN
crash
(5.2.4)
NAN
NaN<big-box><little-box><E-with-backslash-on-top>
(5.3.0)
NAN
NaN<hex EF BF BD><hex EF BF BD><hex EF BF BD>
(viewed in browser as NaN???)
--
Edit bug report at http://bugs.php.net/?id=49244&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49244&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49244&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49244&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49244&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49244&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49244&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49244&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49244&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49244&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49244&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49244&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49244&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49244&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49244&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49244&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49244&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49244&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49244&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49244&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49244&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49244&r=mysqlcfg
Thread (14 messages)
- ronlentjes at yahoo dot com dot au
- rasmus@php.net#49244 [Opn]: Floating point NaN cause garbage characters
- ronlentjes at yahoo dot com dot au#49244 [Opn]: Floating point NaN cause garbage characters
- sjoerd-php at linuxonly dot nl#49244 [Com]: Floating point NaN cause garbage characters
- sjoerd-php at linuxonly dot nl#49244 [Com]: Floating point NaN cause garbage characters
- sjoerd@php.net#49244 [Opn->Ver]: Floating point NaN cause garbage characters
- garretts@php.net#49244 [Ver]: Floating point NaN cause garbage characters
- sjoerd@php.net#49244 [Ver]: Floating point NaN cause garbage characters
- pajoye@php.net#49244 [Ver->Fbk]: [PATCH] Floating point NaN cause garbage characters
- sjoerd@php.net#49244 [NoF->Ver]: [PATCH] Floating point NaN cause garbage characters
- jani@php.net#49244 [Ver->Asn]: [PATCH] Floating point NaN cause garbage characters
- felipe@php.net#49244 [Asn->Csd]: [PATCH] Floating point NaN cause garbage characters
- pajoye@php.net#49244 [Csd->Asn]: [PATCH] Floating point NaN cause garbage characters
- pajoye@php.net#49244 [Asn->Csd]: [PATCH] Floating point NaN cause garbage characters