ID:               34832
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dolecek at stringdata dot cz
-Status:           Open
+Status:           Feedback
-Bug Type:         Reproducible crash
+Bug Type:         Strings related
 Operating System: Windows 2000
 PHP Version:      5.0.5
 New Comment:

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 possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2005-10-11 17:31:41] dolecek at stringdata dot cz

Description:
------------
I'm using PHP with Apache 1.3.23 via apache module, using windows PHP
binaries downloaded from php.net.

If several parallelly running scripts execute same blocks of code using
sprintf("%.2f", $somefloat*$otherfloat), occassionally incorrect float
number is printed or even one character of the "float" contains binary
NUL.

Easy way to trigger this is to have a FPDF script generating a PDF
document, and have something which calls this script via web request in
parallel, so that all scripts are executed within the context of single
web server process. The problem appears in about 1% of generated
documents. The problem is repeatably in my environment, I can try to
put together simplier version of reproducing script if need be.

If I replace the above contruct with
number_format($somefloat*$otherfloat, 2, '.', ''), it works without
problem and no problem occurs.

The length of the gardbled output always exactly matches the length of
non-gardbled output, FWIW.

This suggests there is some kind of reentrancy problem with the
sprintf() routine, at least when printing floats. Perhaps some stack
alignment issue or something equally esoteric?

The problem exists in 5.1b3, 5.1.0rc1, 5.0.5. I did not check other
versions.

The type of bug has been set to repoducible crash due to missing
'Memory corruption' category and since this _might_ cause a crash (tho
no crash has been observed) - feel free to change to anything more
appropriate if need be.

Bug #21659 might actually be same problem, tho #21659 has been shrugged
off as miscompilation problem.




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


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

Reply via email to