#45983 [Opn]: Is interaction between strval() and "precision" setting in php.ini intended?
ID: 45983 User updated by: ivoras at gmail dot com -Summary: strval() on float values sometimes gives invalid output Reported By: ivoras at gmail dot com Status: Open Bug Type: Scripting Engine problem Operating System: FreeBSD PHP Version: 5.2.6 New Comment: Addition to the bug report: I tracked the issue down to the "precision" setting in php.ini. When set to "4", when strval() receives a number with 4 digits to the left of the decimal point, the output will only be a string og 4 digits. E.g. strval(1001.1) returns "1001". The documentation for "precision" setting says: """ precision integer The number of significant digits displayed in floating point numbers. """ It doesn't mention strval() (and strval() manual page doesn't mention "precision") and it's a bit ambiguous. (the behaviour is the same on Linux and FreeBSD). Previous Comments: ---------------- [2008-09-03 13:32:03] ivoras at gmail dot com Description: Calling strval() on certain floating point numbers (not all) on FreeBSD sometimes inexplicably truncates or rounds the result. Checked on both FreeBSD 6.3 and 7.0. Works fine in Linux. Reproduce code: --- Expected result: "4867.8" Actual result: -- "4867" -- Edit this bug report at http://bugs.php.net/?id=45983&edit=1
#45983 [NEW]: strval() on float values sometimes gives invalid output
From: ivoras at gmail dot com Operating system: FreeBSD PHP version: 5.2.6 PHP Bug Type: Scripting Engine problem Bug description: strval() on float values sometimes gives invalid output Description: Calling strval() on certain floating point numbers (not all) on FreeBSD sometimes inexplicably truncates or rounds the result. Checked on both FreeBSD 6.3 and 7.0. Works fine in Linux. Reproduce code: --- Expected result: "4867.8" Actual result: -- "4867" -- Edit bug report at http://bugs.php.net/?id=45983&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45983&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45983&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45983&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=45983&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=45983&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=45983&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=45983&r=needscript Try newer version:http://bugs.php.net/fix.php?id=45983&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=45983&r=support Expected behavior:http://bugs.php.net/fix.php?id=45983&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=45983&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=45983&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=45983&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45983&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=45983&r=dst IIS Stability:http://bugs.php.net/fix.php?id=45983&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=45983&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=45983&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=45983&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=45983&r=mysqlcfg
#37197 [NoF->Opn]: PHP module in apache crashes in session (de)serializer
ID: 37197 User updated by: ivoras at gmail dot com Reported By: ivoras at gmail dot com -Status: No Feedback +Status: Open Bug Type: Reproducible crash Operating System: FreeBSD 6.1 -PHP Version: 5.1.2 +PHP Version: 5.1.4 New Comment: It seems the error has shifted a little in 5.1.4: [Fri May 12 13:03:58 2006] pid 3810 mod_whatkilledus sig 11 crash [Fri May 12 13:03:58 2006] pid 3810 mod_whatkilledus active connection: 66.249.65.69:62198->161.53.72.111:80 (conn_rec 849a128) [Fri May 12 13:03:58 2006] pid 3810 mod_whatkilledus active request (request_rec 84a0050): GET /?_v1=UiaTP11W-xj-_aMLa-IM-s3dNpKkD1N18MeEdd3lK1Fbv52UWpuATJG4sunCs2irObY6-B8xOL6GJbN1EuDH6GmE7NixIfomlpN0tRuL_yX0qynVi cTREmixmUl-AXf8uShbk4UXEftRJxYeH-jB7Qryjgj1MIwy1tFvtNPTd8mHH6L9nObm7vZ0PH5Q881NL7qw7pFXsgc8M_rNOYdIvk88e6EHO70PAT-AIHVIqZPn66jXkisr05B3hm_t dMYP5t9L4g03tFV6r6i7bWxcgihn3F4tTHzCX-Szg3XiCro=&_lid=6562 HTTP/1.1|Host:|Connection:Keep-alive|Accept:*/*|From:googlebot(at)goog lebot.com|User-Agent:Mozilla/5.0 (compatible; Googlebot/2.1; +http%3a//www.google.com/bot.html)|Accept-Encoding:gzip [Fri May 12 13:03:58 2006] pid 3810 mod_whatkilledus end of report [Fri May 12 13:03:58 2006] pid 3810 mod_backtrace backtrace for sig 11 (thread "pid" 3810) [Fri May 12 13:03:58 2006] pid 3810 mod_backtrace main() is at 806a950 0x8071e65 at /usr/local/sbin/httpd [EMAIL PROTECTED] at /usr/local/sbin/httpd [EMAIL PROTECTED] 0x2864287d <_zval_ptr_dtor+65> at /usr/local/libexec/apache2/libphp5.so 0x28656874 at /usr/local/libexec/apache2/libphp5.so 0x2864d5ef <_zval_dtor_func+115> at /usr/local/libexec/apache2/libphp5.so 0x2864287d <_zval_ptr_dtor+65> at /usr/local/libexec/apache2/libphp5.so 0x28656944 at /usr/local/libexec/apache2/libphp5.so 0x286676a5 at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so 0x286671d9 at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so 0x286671d9 at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so 0x286acf0c at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so 0x286671d9 at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so 0x286671d9 at /usr/local/libexec/apache2/libphp5.so 0x28666f99 at /usr/local/libexec/apache2/libphp5.so [Fri May 12 13:03:58 2006] pid 3810 mod_backtrace end of backtrace [Fri May 12 13:03:58 2006] [notice] child pid 3810 exit signal Segmentation fault (11) Previous Comments: [2006-05-03 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2006-04-25 13:04:12] [EMAIL PROTECTED] Yes, I do have a reason. You don't have to touch the production PHP and Apache - you can always install it into different location and listening on another port. -------------------- [2006-04-25 12:38:28] ivoras at gmail dot com Do you have a reason to believe this will help me - are there any changes in the session serializing code between the two versions? (This is a production machine and I can't risk downtime when I try the snapshot). [2006-04-25 12:09:11] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip ---------------- [2006-04-25 12:07:36] ivoras at gmail dot com Description: PHP module in apache randomly crashes. Tried building debug version of PHP, but it doesn't change anything (there is no significant additional data in apache error logs). Attached is the result of Apache modules mod_whatkilledus and mod_backtrace. The problem seems to be this: "httpd in malloc(): error: recursive call" Talking to FreeBSD developers, this most likely happens if an application tries to use malloc() from a signal handler, while another malloc() is in progress, which apparently is allowed by GNU malloc() but not by BSD malloc(). Reproduce code: --- Cannot pinpoint crash location - possibly random or before/after PHP code starts to execute. Expected result: Normal operation. Actual result: -- [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus sig 6 crash [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus active connection: 194.213.26.11:606
#37197 [Fbk->Opn]: PHP module in apache crashes in session (de)serializer
ID: 37197 User updated by: ivoras at gmail dot com Reported By: ivoras at gmail dot com -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: FreeBSD 6.1 PHP Version: 5.1.2 New Comment: Do you have a reason to believe this will help me - are there any changes in the session serializing code between the two versions? (This is a production machine and I can't risk downtime when I try the snapshot). Previous Comments: [2006-04-25 12:09:11] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2006-04-25 12:07:36] ivoras at gmail dot com Description: PHP module in apache randomly crashes. Tried building debug version of PHP, but it doesn't change anything (there is no significant additional data in apache error logs). Attached is the result of Apache modules mod_whatkilledus and mod_backtrace. The problem seems to be this: "httpd in malloc(): error: recursive call" Talking to FreeBSD developers, this most likely happens if an application tries to use malloc() from a signal handler, while another malloc() is in progress, which apparently is allowed by GNU malloc() but not by BSD malloc(). Reproduce code: --- Cannot pinpoint crash location - possibly random or before/after PHP code starts to execute. Expected result: Normal operation. Actual result: -- [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus sig 6 crash [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus active connection: 194.213.26.11:60632->161.53.72.111:80 (conn_rec 8498128) [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus active request (request_rec 849e050): GET /zvne/alumni?_v1=U-7HlKuFSMHIHduAAExHdmGM_tcn2Vp3MqonoAYek-3EDnfH4VQDVQjKNRBSm6hh&_lid=10213 HTTP/1.1|User-Agent:Mozilla/5.0 (compatib le; Pogodak.hr/3.1)|Cookie:phpbb2mysql_sid=c61f99db46b5a2b837340e294ccb5a5a; phpbb2mysql_data=a%253A2%253A%257Bs%253A11%253A%2522autologin id%2522%253Bs%253A0%253A%2522%2522%253Bs%253A6%253A%2522userid%2522%253Bi%253A-1%253B%257D; CMS=6c9d1e5a98c7927a10ff0d0d47e902e1; CMS=6c9d 1e5a98c7927a10ff0d0d47e902e1|Accept-Language:hr|Cache-Control:no-cache|Pragma:no-cache|Host:www.zvne.fer.hr|Accept:text/html, image/gif, i mage/jpeg, *; q=.2, */*; q=.2|Connection:keep-alive|Content-type:application/x-www-form-urlencoded [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus end of report [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace backtrace for sig 6 (thread "pid" 28734) [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace main() is at 806a950 0x8071e65 at /usr/local/sbin/httpd [EMAIL PROTECTED] at /usr/local/sbin/httpd [EMAIL PROTECTED] 0x284133d4 at /lib/libc.so.6 0x283b9b03 <_UTF8_init+1875> at /lib/libc.so.6 0x283b9b31 <_UTF8_init+1921> at /lib/libc.so.6 0x283babb8 <_UTF8_init+6152> at /lib/libc.so.6 0x28653915 <_emalloc+197> at /usr/local/libexec/apache2/libphp5.so 0x28632152 at /usr/local/libexec/apache2/libphp5.so 0x2862e68b at /usr/local/libexec/apache2/libphp5.so 0x28669809 at /usr/local/libexec/apache2/libphp5.so 0x2865f60d at /usr/local/libexec/apache2/libphp5.so 0xbfbfff94 0x28653cb7 <_erealloc+179> at /usr/local/libexec/apache2/libphp5.so 0x28611c63 at /usr/local/libexec/apache2/libphp5.so 0x28611abd at /usr/local/libexec/apache2/libphp5.so 0x28611abd at /usr/local/libexec/apache2/libphp5.so 0x28614a87 at /usr/local/libexec/apache2/libphp5.so 0x2894ec16 at /usr/local/lib/php/20050922-debug/session.so 0x2894f117 at /usr/local/lib/php/20050922-debug/session.so [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace end of backtrace [Tue Apr 25 13:46:27 2006] [notice] child pid 28734 exit signal Abort trap (6) httpd in malloc(): error: recursive call -- Edit this bug report at http://bugs.php.net/?id=37197&edit=1
#37197 [NEW]: PHP module in apache crashes in session (de)serializer
From: ivoras at gmail dot com Operating system: FreeBSD 6.1 PHP version: 5.1.2 PHP Bug Type: Reproducible crash Bug description: PHP module in apache crashes in session (de)serializer Description: PHP module in apache randomly crashes. Tried building debug version of PHP, but it doesn't change anything (there is no significant additional data in apache error logs). Attached is the result of Apache modules mod_whatkilledus and mod_backtrace. The problem seems to be this: "httpd in malloc(): error: recursive call" Talking to FreeBSD developers, this most likely happens if an application tries to use malloc() from a signal handler, while another malloc() is in progress, which apparently is allowed by GNU malloc() but not by BSD malloc(). Reproduce code: --- Cannot pinpoint crash location - possibly random or before/after PHP code starts to execute. Expected result: Normal operation. Actual result: -- [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus sig 6 crash [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus active connection: 194.213.26.11:60632->161.53.72.111:80 (conn_rec 8498128) [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus active request (request_rec 849e050): GET /zvne/alumni?_v1=U-7HlKuFSMHIHduAAExHdmGM_tcn2Vp3MqonoAYek-3EDnfH4VQDVQjKNRBSm6hh&_lid=10213 HTTP/1.1|User-Agent:Mozilla/5.0 (compatib le; Pogodak.hr/3.1)|Cookie:phpbb2mysql_sid=c61f99db46b5a2b837340e294ccb5a5a; phpbb2mysql_data=a%253A2%253A%257Bs%253A11%253A%2522autologin id%2522%253Bs%253A0%253A%2522%2522%253Bs%253A6%253A%2522userid%2522%253Bi%253A-1%253B%257D; CMS=6c9d1e5a98c7927a10ff0d0d47e902e1; CMS=6c9d 1e5a98c7927a10ff0d0d47e902e1|Accept-Language:hr|Cache-Control:no-cache|Pragma:no-cache|Host:www.zvne.fer.hr|Accept:text/html, image/gif, i mage/jpeg, *; q=.2, */*; q=.2|Connection:keep-alive|Content-type:application/x-www-form-urlencoded [Tue Apr 25 13:46:26 2006] pid 28734 mod_whatkilledus end of report [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace backtrace for sig 6 (thread "pid" 28734) [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace main() is at 806a950 0x8071e65 at /usr/local/sbin/httpd [EMAIL PROTECTED] at /usr/local/sbin/httpd [EMAIL PROTECTED] 0x284133d4 at /lib/libc.so.6 0x283b9b03 <_UTF8_init+1875> at /lib/libc.so.6 0x283b9b31 <_UTF8_init+1921> at /lib/libc.so.6 0x283babb8 <_UTF8_init+6152> at /lib/libc.so.6 0x28653915 <_emalloc+197> at /usr/local/libexec/apache2/libphp5.so 0x28632152 at /usr/local/libexec/apache2/libphp5.so 0x2862e68b at /usr/local/libexec/apache2/libphp5.so 0x28669809 at /usr/local/libexec/apache2/libphp5.so 0x2865f60d at /usr/local/libexec/apache2/libphp5.so 0xbfbfff94 0x28653cb7 <_erealloc+179> at /usr/local/libexec/apache2/libphp5.so 0x28611c63 at /usr/local/libexec/apache2/libphp5.so 0x28611abd at /usr/local/libexec/apache2/libphp5.so 0x28611abd at /usr/local/libexec/apache2/libphp5.so 0x28614a87 at /usr/local/libexec/apache2/libphp5.so 0x2894ec16 at /usr/local/lib/php/20050922-debug/session.so 0x2894f117 at /usr/local/lib/php/20050922-debug/session.so [Tue Apr 25 13:46:26 2006] pid 28734 mod_backtrace end of backtrace [Tue Apr 25 13:46:27 2006] [notice] child pid 28734 exit signal Abort trap (6) httpd in malloc(): error: recursive call -- Edit bug report at http://bugs.php.net/?id=37197&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37197&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=37197&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37197&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37197&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37197&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37197&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=37197&r=needscript Try newer version:http://bugs.php.net/fix.php?id=37197&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37197&r=support Expected behavior:http://bugs.php.net/fix.php?id=37197&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37197&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37197&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37197&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37197&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37197&r=dst IIS Stability:http://bugs.php.net/fix.php?id=37197&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37197&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37197&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37197&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=37197&r=mysqlcfg