#48387 [Asn]: ArrayObject and properties serialization
ID: 48387 Updated by: s...@php.net Reported By: david at grudl dot com Status: Assigned Bug Type: SPL related Operating System: * PHP Version: 5.2.9 Assigned To: colder New Comment: For what it's worth, the reproduce code works perfectly fine with php5.3.0 Previous Comments: [2009-05-25 15:46:56] david at grudl dot com Description: In PHP 5.2.x there are not serialized any public/protected/private properies of ArrayObject descendants. Reproduce code: --- class Test extends ArrayObject { public $var; } $test = new Test; $test->var = 'hello'; $dolly = unserialize(serialize($test)); echo $dolly->var; Expected result: -> hello Actual result: -- none -- Edit this bug report at http://bugs.php.net/?id=48387&edit=1
#51172 [NEW]: errors while sending results of "make test"
From: bradgrafelman at gmail dot com Operating system: CentOS 5 PHP version: 6SVN-2010-02-28 (SVN) PHP Bug Type: *Compile Issues Bug description: errors while sending results of "make test" Description: After running the "make tests" as recommended, I was prompted to send the results to QA since some of them failed. After entering my e-mail address, I received the errors/warnings/notices posted below. Is this normal? Actual result: -- Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x8B) at offset 1) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x95) at offset 6) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 137) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 25) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 24) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 37) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 36) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 142) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 1) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 6) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 133) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 159) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 129) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 134) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 135) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 139) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 131) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xE2,0xA5) at offset 136) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xA3) at offset 133) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xA3) at offset 63) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x80) at offset 1809) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x80) at offset 4708) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x89) at offset 0) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x89) at offset 5) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xA4) at offset 295) in /root/php/php6/run-tests.php on line 365 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0xA4) at offset 60) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x82) at offset 12) in /root/php/php6/run-tests.php on line 366 Warning: Could not convert binary string to Unicode string (converter UTF-8 failed on bytes (0x82) at offset 267) in /root/php/php6/run-tests.php on line
#51173 [NEW]: Unserialized objects with prototype changes results in duplicated properties
From: s...@php.net Operating system: Win7 PHP version: 5.3.2RC3 PHP Bug Type: Scripting Engine problem Bug description: Unserialized objects with prototype changes results in duplicated properties Description: If you serialize an object in the session and then change the properties declaration from public to protected (or any other change), the unserialized objects will have duplicated properties, once public and once protected, and the object will not be able to read the public value so it means the object state is broken. This is obviously due to the way the protected values are stored as "\0*\0property" => "value", but I still think the default unserializer code should check if "property" exists, and fill it no matter what the access level is, rather than creating another property with the same name. I don't know how easy it'd be and how it would impact performance though, but it's quite scary that the engine even allows having two properties with different access levels and the same name. Reproduce code: --- // Run once like this, then change public $property to protected $property, run again and look at var_dump output session_start(); class testClass { public $property; public function __construct($val) { $this->property = $val; } } if (!isset($_SESSION['obj'])) { $_SESSION['obj'] = new testClass('value'); } var_dump($_SESSION['obj']); Expected result: object(testClass)[1] protected 'property' => string 'value' (length=5) Actual result: -- object(testClass)[1] protected 'property' => null public 'property' => string 'value' (length=5) -- Edit bug report at http://bugs.php.net/?id=51173&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51173&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51173&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51173&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51173&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51173&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51173&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51173&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51173&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51173&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51173&r=support Expected behavior: http://bugs.php.net/fix.php?id=51173&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51173&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51173&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51173&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51173&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51173&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51173&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51173&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51173&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51173&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51173&r=mysqlcfg
#51170 [Opn->Bgs]: json_decode should inform about magic_quotes_gpc
ID: 51170 Updated by: johan...@php.net Reported By: nadavvin at gmail dot com -Status: Open +Status: Bogus Bug Type: JSON related Operating System: linux PHP Version: 5.2.13 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: [2010-02-27 17:56:31] nadavvin at gmail dot com Description: php 5.2.10 if magic_quotes_gpc is on then json_decode failed to decode. It should unescape it's input if magic_quotes_gpc is on. -- Edit this bug report at http://bugs.php.net/?id=51170&edit=1
#51173 [Opn->Bgs]: Unserialized objects with prototype changes results in duplicated properties
ID: 51173 Updated by: johan...@php.net Reported By: s...@php.net -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Win7 PHP Version: 5.3.2RC3 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Fixing this creates more issues, like performance drop, than it solves. Previous Comments: [2010-02-28 11:12:23] s...@php.net Description: If you serialize an object in the session and then change the properties declaration from public to protected (or any other change), the unserialized objects will have duplicated properties, once public and once protected, and the object will not be able to read the public value so it means the object state is broken. This is obviously due to the way the protected values are stored as "\0*\0property" => "value", but I still think the default unserializer code should check if "property" exists, and fill it no matter what the access level is, rather than creating another property with the same name. I don't know how easy it'd be and how it would impact performance though, but it's quite scary that the engine even allows having two properties with different access levels and the same name. Reproduce code: --- // Run once like this, then change public $property to protected $property, run again and look at var_dump output session_start(); class testClass { public $property; public function __construct($val) { $this->property = $val; } } if (!isset($_SESSION['obj'])) { $_SESSION['obj'] = new testClass('value'); } var_dump($_SESSION['obj']); Expected result: object(testClass)[1] protected 'property' => string 'value' (length=5) Actual result: -- object(testClass)[1] protected 'property' => null public 'property' => string 'value' (length=5) -- Edit this bug report at http://bugs.php.net/?id=51173&edit=1
#51167 [Opn]: crypt() hangs randomly when called with a salt
ID: 51167 Updated by: paj...@php.net Reported By: david dot joffe at tshwanedje dot com Status: Open Bug Type: *Encryption and hash functions Operating System: Windows PHP Version: 5.3.1 New Comment: Please try using PHP 5.3.2RC3. http://windows.php.net/qa/ Previous Comments: [2010-02-27 15:24:34] david dot joffe at tshwanedje dot com Description: crypt($username, "x8"); // HANGS (Sometimes e.g. 1 out of every 3 times or so) crypt($username); // NO HANG Reproduce code: --- $username = 'foo'; crypt($username, "x8"); Actual result: -- Hangs -- Edit this bug report at http://bugs.php.net/?id=51167&edit=1
#51167 [Opn->Fbk]: crypt() hangs randomly when called with a salt
ID: 51167 Updated by: paj...@php.net Reported By: david dot joffe at tshwanedje dot com -Status: Open +Status: Feedback Bug Type: *Encryption and hash functions Operating System: Windows PHP Version: 5.3.1 Previous Comments: [2010-02-28 12:48:14] paj...@php.net Please try using PHP 5.3.2RC3. http://windows.php.net/qa/ [2010-02-27 15:24:34] david dot joffe at tshwanedje dot com Description: crypt($username, "x8"); // HANGS (Sometimes e.g. 1 out of every 3 times or so) crypt($username); // NO HANG Reproduce code: --- $username = 'foo'; crypt($username, "x8"); Actual result: -- Hangs -- Edit this bug report at http://bugs.php.net/?id=51167&edit=1
#50891 [Com]: Crash on mysql_connect
ID: 50891 Comment by: apaleftos at gmail dot com Reported By: other dot pouya at gmail dot com Status: No Feedback Bug Type: MySQL related Operating System: win32 only - Win XP PHP Version: 5.2.12 New Comment: I have the exact same problem, same php/mysql/apache versions Previous Comments: [2010-02-08 01:00:01] 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". [2010-01-31 16:25:55] other dot pouya at gmail dot com Thanks for you attention. I checked the link you provide but there was nothing there. It was just written "5.2 has no release" as well as other versions. [2010-01-31 14:33:40] j...@php.net Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2010-01-31 03:13:45] other dot pouya at gmail dot com Description: Dear PHP team I have apache 2.2.14 , php 5.2.12 and mysql 5.1 running on XP. Php and apache are fine when I test phpinfo() or other php commands which are not related to mysql. But when I try to connect to mysql, the apache sever crashes and the following error pops up: Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. clicking for details I have this error signature: szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : ac6a I ran the code step by step, and I realize the problem is related to the line $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); This is apache error.log after clicking "don't send" on the crashing pop-up: [Sun Jan 31 04:03:57 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Sun Jan 31 04:03:57 2010] [notice] Apache/2.2.14 (Win32) PHP/5.2.12 configured -- resuming normal operations [Sun Jan 31 04:03:57 2010] [notice] Server built: Sep 28 2009 22:41:08 [Sun Jan 31 04:03:57 2010] [notice] Parent: Created child process 584 [Sun Jan 31 04:03:58 2010] [notice] Child 584: Child process is running [Sun Jan 31 04:03:58 2010] [notice] Child 584: Acquired the start mutex. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting 64 worker threads. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting thread to listen on port 80. Reproduce code: --- Expected result: Connecting to mysql. Actual result: -- Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : ac6a -- Edit this bug report at http://bugs.php.net/?id=50891&edit=1
#36424 [Opn->Fbk]: Serializable interface breaks object references
ID: 36424 Updated by: j...@php.net Reported By: mastabog at hotmail dot com -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: * -PHP Version: 5.1.3RC2-dev +PHP Version: 5.2.12 Assigned To: helly New Comment: Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: [2010-02-27 02:30:14] mastabog at hotmail dot com I know it's been over 1 year since you asked me to try the latest CVS snapshot but ... ... the bug is still there in 5.2.12 (Windows)! Yuu can try the reproduce code from the first post. Can this be fixed please? [2008-11-10 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". [2008-11-02 12:31:03] j...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2006-07-22 22:11:56] mastabog at hotmail dot com I'm not sure if we drifted away from the original bug report I made in the first post. Has there been any progress on the original bug or plans to fix it anytime soon? I see the bug is still open so i take it the maintainer regards it as a bug that needs fixing. The latest snapshot I tried of php 5.2 from July 21 2006 still experiences the same problem. [2006-06-06 21:27:58] he...@php.net It's still assigned to me. 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/36424 -- Edit this bug report at http://bugs.php.net/?id=36424&edit=1
#50891 [NoF->Fbk]: Crash on mysql_connect
ID: 50891 Updated by: paj...@php.net Reported By: other dot pouya at gmail dot com -Status: No Feedback +Status: Feedback Bug Type: MySQL related Operating System: win32 only - Win XP PHP Version: 5.2.12 New Comment: Try with 5.2.13. Also be sure that you don't have any other libmysql DLL in your PATH but the one we bundled in PHP releases. That may happen if you installed mysql after PHP. Previous Comments: [2010-02-28 15:05:41] apaleftos at gmail dot com I have the exact same problem, same php/mysql/apache versions [2010-02-08 01:00:01] 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". [2010-01-31 16:25:55] other dot pouya at gmail dot com Thanks for you attention. I checked the link you provide but there was nothing there. It was just written "5.2 has no release" as well as other versions. [2010-01-31 14:33:40] j...@php.net Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2010-01-31 03:13:45] other dot pouya at gmail dot com Description: Dear PHP team I have apache 2.2.14 , php 5.2.12 and mysql 5.1 running on XP. Php and apache are fine when I test phpinfo() or other php commands which are not related to mysql. But when I try to connect to mysql, the apache sever crashes and the following error pops up: Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. clicking for details I have this error signature: szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : ac6a I ran the code step by step, and I realize the problem is related to the line $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); This is apache error.log after clicking "don't send" on the crashing pop-up: [Sun Jan 31 04:03:57 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Sun Jan 31 04:03:57 2010] [notice] Apache/2.2.14 (Win32) PHP/5.2.12 configured -- resuming normal operations [Sun Jan 31 04:03:57 2010] [notice] Server built: Sep 28 2009 22:41:08 [Sun Jan 31 04:03:57 2010] [notice] Parent: Created child process 584 [Sun Jan 31 04:03:58 2010] [notice] Child 584: Child process is running [Sun Jan 31 04:03:58 2010] [notice] Child 584: Acquired the start mutex. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting 64 worker threads. [Sun Jan 31 04:03:58 2010] [notice] Child 584: Starting thread to listen on port 80. Reproduce code: --- Expected result: Connecting to mysql. Actual result: -- Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience. szAppName : httpd.exe szAppVer : 2.2.14.0 szModName : php5ts.dll szModVer : 5.2.12.12 offset : ac6a -- Edit this bug report at http://bugs.php.net/?id=50891&edit=1
#51168 [Opn->Bgs]: Userland Cyclic Reference with Nested DateTime are not garbage collected
ID: 51168 Updated by: j...@php.net Reported By: kontakt at beberlei dot de -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux/Ubuntu PHP Version: 5.3.1 New Comment: Ok. Previous Comments: [2010-02-27 16:49:35] kontakt at beberlei dot de Sorry it seems this is a duplicate of http://bugs.php.net/bug.php?id=49700 [2010-02-27 16:45:34] kontakt at beberlei dot de Description: When one of the participants of a cyclic reference holds a reference to a DateTime instance, the GC seems to be unable to do its job. NOTE: Even without a DateTime reference memory keeps increasing slowly but steadily. This is not the case as soon as either $a->b = $b or $b->a = $a is commented out, i.e. the cyclic reference is removed. So even though the GC seems to work almost perfectly (without a DateTime reference), a small leak remains. The leakage also occurs with PDO, however not with other php internal objects. Reproduce code: --- class A { public $b; public $ref; function __construct() { $this->ref = new DateTime; // "large" leak. comment out for small leak. } } class B { public $a; } for ($i=1; $i<=20; ++$i) { $a = new A; $b = new B; $a->b = $b; // comment out to avoid any leakage, with or without DateTime, doesnt matter. $b->a = $a; // comment out to avoid any leakage, with or without DateTime, doesnt matter. if ($i % 1 == 0) { gc_collect_cycles(); printf('- Memory usage after %d iterations: %2.2f MB' .PHP_EOL, $i, memory_get_usage() / 1024 / 1024); } } Expected result: - Memory usage after 1 iterations: 0.79 MB - Memory usage after 2 iterations: 0.79 MB - Memory usage after 3 iterations: 0.79 MB - Memory usage after 4 iterations: 0.79 MB - Memory usage after 5 iterations: 0.79 MB - Memory usage after 6 iterations: 0.79 MB - Memory usage after 7 iterations: 0.79 MB - Memory usage after 8 iterations: 0.79 MB - Memory usage after 9 iterations: 0.79 MB - Memory usage after 10 iterations: 0.79 MB Actual result: -- - Memory usage after 1 iterations: 4.53 MB - Memory usage after 2 iterations: 8.38 MB - Memory usage after 3 iterations: 12.15 MB - Memory usage after 4 iterations: 15.90 MB - Memory usage after 5 iterations: 19.65 MB - Memory usage after 6 iterations: 23.40 MB - Memory usage after 7 iterations: 27.15 MB - Memory usage after 8 iterations: 30.90 MB - Memory usage after 9 iterations: 34.65 MB - Memory usage after 10 iterations: 38.41 MB -- Edit this bug report at http://bugs.php.net/?id=51168&edit=1
#51152 [Opn->Bgs]: socket_select
ID: 51152 Updated by: j...@php.net Reported By: 9669105 at qq dot com -Status: Open +Status: Bogus Bug Type: CGI related Operating System: windows xp PHP Version: 5.2.13 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: [2010-02-26 07:35:43] 9669105 at qq dot com Description: I am not good at english . I pass an array with 257 sockets to monitor for changes, a warning : unable to select [0]:An operation was attempted on something that is not a socket. Why? Reproduce code: --- $i = 0; $sockets = array(); while (true) { $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (socket_connect($socket, '192.168.1.101', 11001)) { socket_set_nonblock($socket); $sockets[] = $socket; $i = $i + 1; } else { break; } } echo $i; Expected result: $i=257 always. How can pass an array more than 257 sockets ? -- Edit this bug report at http://bugs.php.net/?id=51152&edit=1
#51159 [Opn->Fbk]: session_set_save_handler Memory Corruption
ID: 51159 Updated by: j...@php.net Reported By: achristianson at yakabod dot com -Status: Open +Status: Feedback -Bug Type: Reproducible crash +Bug Type: Session related Operating System: CentOS 5.4 PHP Version: 5.3.1 New Comment: Try turn garbage collection of so we know if it's that.. zend.enable_gc = off, IIRC. :) Previous Comments: [2010-02-26 19:08:01] achristianson at yakabod dot com We tried this with Zend MM and garbage collection turned on and off. No change in result. [2010-02-26 18:49:11] achristianson at yakabod dot com Small typo: I put 5.2.1 and 5.2.3RC3 text along with my backtraces. I meant to type 5.3.1 and 5.3.2RC3 respectively. [2010-02-26 18:39:55] achristianson at yakabod dot com Description: Use of session_set_save_handler seems to cause memory corruption under certain conditions. Inside of _write, there is code that causes a fatal error. The corruption seems to not happen if this is removed. I get the problem in both 5.3.1 and 5.3.2RC3 Reproduce code: --- u.var); (gdb) bt #0 0x014899c0 in ZEND_ASSIGN_SPEC_CV_CONST_HANDLER (execute_data=0x9a6ee80) at /root/php-5.3.1/Zend/zend_execute.c:302 #1 0x0142d55d in execute (op_array=0x9a0e260) at /root/php- 5.3.1/Zend/zend_vm_execute.h:104 #2 0x0140bd57 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-5.3.1/Zend/zend.c:1194 #3 0x013bbf4e in php_execute_script (primary_file=0xbfa7c8c0) at /root/php-5.3.1/main/main.c:2225 #4 0x0148ad2b in php_handler (r=0x9a56160) at /root/php- 5.3.1/sapi/apache2handler/sapi_apache2.c:648 #5 0x08077bf3 in ap_invoke_handler () #6 0x080868df in ap_process_request () #7 0x080839e8 in ?? () #8 0x09a56160 in ?? () #9 0x0004 in ?? () #10 0x09a56160 in ?? () #11 0x0987c2f8 in ?? () #12 0x0002 in ?? () #13 0x09a43be8 in ?? () #14 0xbfa7c9c8 in ?? () #15 0x0807ff45 in ap_process_connection () 5.2.3RC3 backtrace: Program received signal SIGSEGV, Segmentation fault. _zval_ptr_dtor (zval_ptr=0xbf900928) at /root/php- 5.3.2RC3/Zend/zend.h:385 385return --pz->refcount__gc; (gdb) bt #0 _zval_ptr_dtor (zval_ptr=0xbf900928) at /root/php- 5.3.2RC3/Zend/zend.h:385 #1 0x014674fc in zend_do_fcall_common_helper_SPEC (execute_data=0x8558d30) at /root/php-5.3.2RC3/Zend/zend_execute.h:316 #2 0x01441b3d in execute (op_array=0x84f66d0) at /root/php- 5.3.2RC3/Zend/zend_vm_execute.h:104 #3 0x01420207 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/php-5.3.2RC3/Zend/zend.c:1194 #4 0x013cfe7e in php_execute_script (primary_file=0xbf902c10) at /root/php-5.3.2RC3/main/main.c:2260 #5 0x0149f22b in php_handler (r=0x853e5b8) at /root/php- 5.3.2RC3/sapi/apache2handler/sapi_apache2.c:655 #6 0x08077bf3 in ap_invoke_handler () #7 0x080868df in ap_process_request () #8 0x080839e8 in ?? () #9 0x0853e5b8 in ?? () #10 0x0004 in ?? () #11 0x0853e5b8 in ?? () #12 0x08388758 in ?? () #13 0x0002 in ?? () #14 0x0852c040 in ?? () #15 0xbf902d18 in ?? () #16 0x0807ff45 in ap_process_connection () -- Edit this bug report at http://bugs.php.net/?id=51159&edit=1
#51174 [NEW]: error "expected to be a reference" when $this referenced in an array property
From: skrol29forum at gmail dot com Operating system: Win7 PHP version: 5.3.1 PHP Bug Type: Class/Object related Bug description: error "expected to be a reference" when $this referenced in an array property Description: When $this is stored by reference in a PHP array, itself stored in a property, then function call_user_func_array() is able to recognize the reference only if called in the same local context where $this is referenced. In other words, the reference seems to be lost for call_user_func_array(). The bug does not occur with PHP 5.2, It does occur with both PHP 5.3.0 and PHP 5.3.1. Not yet tested with PHP 5.3.2 Note that if we use a global variable instead of a property, then the bug does not occur. Reproduce code: --- prop++; echo "prop=".$obj->prop." \r\n"; } class clsTest { public $prop = 0; public $arg_array = false; function meth() { if ($this->arg_array===false) $this->arg_array = array(&$this); echo 'arg_array[0] '.(($this->arg_array[0]===$this) ? ' is the same instance' : ' is not the same instance').' than $this'." \r\n"; call_user_func_array('f_test', $this->arg_array); } } $oTest = new clsTest; $oTest->meth(); // OK $oTest->meth(); // ERR ?> Expected result: arg_array[0] is the same instance than $this prop=1 arg_array[0] is the same instance than $this Warning: Parameter 1 to f_test() expected to be a reference, value given in D:\www\bug.php on line 14 Actual result: -- arg_array[0] is the same instance than $this prop=1 arg_array[0] is the same instance than $this prop=2 -- Edit bug report at http://bugs.php.net/?id=51174&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51174&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51174&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51174&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51174&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51174&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51174&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51174&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51174&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51174&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51174&r=support Expected behavior: http://bugs.php.net/fix.php?id=51174&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51174&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51174&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51174&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51174&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51174&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51174&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51174&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51174&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51174&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51174&r=mysqlcfg