|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-09-08 23:42 UTC] voxus at mail dot ru
Description:
------------
php is crashing when trying to serialize any given object.
problem is reproducible on x86_64 arch (known to be ok on
x86 with any sane CFLAGS) with php-5.0.5 (5.0.4 is ok),
for example - AMD Athlon(tm) 64 Processor 3200+.
recompilation with CFLAGS="-O0" or with debug symbols
"solves" the problem.
Reproduce code:
---------------
compile php with CFLAGS="-O2" (yes, nothing more here)
execute from cli:
class foo
{
public function bah()
{
var_dump(serialize($this));
}
}
$foo = new foo();
$foo->bah();
Expected result:
----------------
var_dump'ed serialized object, i.e. - just string
Actual result:
--------------
segmentation fault.
backtrace from php:
(gdb) bt
#0 0x00000037ecf6fb9b in memcpy () from /lib/libc.so.6
#1 0x000000000053c8ed in zif_var_export ()
#2 0x000000000053e419 in php_var_serialize ()
#3 0x000000000053e4d6 in zif_serialize ()
#4 0x00000000005c76cb in zend_do_fcall_common_helper ()
#5 0x00000000005c7941 in zend_do_fcall_handler ()
#6 0x00000000005bad54 in execute ()
#7 0x00000000005c721e in zend_do_fcall_common_helper ()
#8 0x00000000005bad54 in execute ()
#9 0x0000000000597806 in zend_execute_scripts ()
#10 0x000000000055e379 in php_execute_script ()
#11 0x00000000005d1779 in main ()
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
(gdb) f 1 #1 0x00000000004ee11a in php_var_serialize_class_name (buf=0x7fbfffce40, struc=0x7f00000013) at /usr/src/php-5.0.5/ext/standard/var.c:519 519 smart_str_appendl(buf, class_name, name_len);