Edit report at http://bugs.php.net/bug.php?id=51396&edit=1

 ID:               51396
 Comment by:       codeslinger at compsalot dot com
 Reported by:      codeslinger at compsalot dot com
 Summary:          Math is Unreliable
 Status:           Feedback
 Type:             Bug
 Package:          Math related
 Operating System: any
 PHP Version:      Irrelevant
 Assigned To:      aharvey

 New Comment:

quote: Btw, it could be due to bad initialized data as well



I don't understand the question/statement.



The program generates all of it's data.



If you look near the bottom of pov.pco.php  you will see the following
line:



echo "FATAL ERROR: PHP Math is Corrupt Again!!! idx = $idx\n";



If you set a breakpoint there in a php debugger and examine the vaules
you will see that that array contains a float of 0.1

and that the string it was converted to is   "0.0:"


Previous Comments:
------------------------------------------------------------------------
[2010-03-26 10:17:47] codeslinger at compsalot dot com

Thank You for the response.



This program executes thousands of identical loops

it performs a number format conversion on each of those thousands of
numbers in it's array.



Out of all of those thousands of identical conversions about 4 of them
will produce an invalid result.



for this specific program, if I skip the array_merge (see $Nest) then
the bug does not occur.



Every time I make a change to the loops etc. the behavior changes, even
to where the bug is not triggered.  I have already simplified this
program quite a bit and the result was that it now fails at a totally
different array index then when I first observed the problem.  The
trigger is very finicky.



XP is not a factor here, even though the original problem was found on
XP, I am running this Snowflake program on Ubuntu Linux.



converting a number to a string should never result in that string
containing a non-numeric character.



I can try to reduce this program further, but really and truly, it is
hard to trigger this -- but once triggered it is totally consistent and
repeatable.

------------------------------------------------------------------------
[2010-03-26 10:11:25] paj...@php.net

Btw, it could be due to bad initialized data as well (as you experience
it on unix as well).



Can you try to run your script under valgrind too?

------------------------------------------------------------------------
[2010-03-26 09:54:33] paj...@php.net

It looks to me in a bug at the number formatting in the Windows API (not
php dependent). Other users met this problem on old XP systems. You
could reproduce it using number_format only. Or maybe only with a single
printf function.



Can you try using another windows box or using 5.3.2-vc9 builds?



Btw, it is not about bad or good attitude but about having something we
can actually use to help you. I can understand your worries after having
spent hours to debug this problem, but we will still use a small script
to debug this problem, if any.

------------------------------------------------------------------------
[2010-03-26 09:40:23] codeslinger at compsalot dot com

did you even LOOOKK  at the script that I provided?



it is not that complicated.  a few loops and some array allocations.

previous attempts to reduce this to anything simpler have been
unsuccessful.



this is exactly the attitude that causes me to be overwrought.

------------------------------------------------------------------------
[2010-03-26 09:30:30] paj...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=51396


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51396&edit=1

Reply via email to