ID: 34435
Comment by: m at aptual dot fi
Reported By: voxus at mail dot ru
Status: Feedback
Bug Type: Reproducible crash
Operating System: Gentoo Linux
PHP Version: 5.0.5
New Comment:
(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);
Previous Comments:
------------------------------------------------------------------------
[2005-09-09 10:33:57] [EMAIL PROTECTED]
That's much better.
And could you plz do:
gdb> f1
after "bt" to see what exactly happens there?
------------------------------------------------------------------------
[2005-09-09 10:23:16] m at aptual dot fi
I'm not sure if this was directed at me, but here's my 2 eurocents
anyway (using the same script):
My GDB output:
http://m.bytech.fi/dev/php505gdb.txt
And with Valgrind:
http://m.bytech.fi/dev/php505valgrind.txt
------------------------------------------------------------------------
[2005-09-09 09:41:50] [EMAIL PROTECTED]
Try to get some more info with valgrind (since the problem is
reproducible only by you).
------------------------------------------------------------------------
[2005-09-09 09:39:24] m at aptual dot fi
I ran into this problem too, however the segmentation fault only occurs
when I use
./configure --with-apxs2=/usr/local/apache/bin/apxs
to compile PHP, instead of just ./configure. Yet the segmentation fault
is not limited to the apache module, but the sapi/cli/php binary crashes
as well. And just as stated by the previous poster, --enable-debug
'fixes' the problem.
I'm using Apache 2.0.52, an SMP kernel version 2.6.8 (x86_64) and gcc
version 3.3.4.
------------------------------------------------------------------------
[2005-09-08 23:42:49] 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 ()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34435&edit=1