php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49551 amfext 0.92 dev cause "Segmentation fault"
Submitted: 2009-09-14 08:21 UTC Modified: 2009-09-14 12:01 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: 200800510 at qq dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.10 OS: centos 4.6 64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: 200800510 at qq dot com
New email:
PHP Version: OS:

 

 [2009-09-14 08:21 UTC] 200800510 at qq dot com
Description:
------------
i use amfext 0.92dev in out project, it's running perfect under windows(windows xp sp3 , php 5.2.6 , mysql 5.0.37, amfext 0.92dev, AMD 64).

but when i use it under centos 4.6 64, it's cause "Segmentation fault".

here is the gdb sessions:

 (gdb) bt
#0  zend_hash_move_forward_ex (ht=Variable "ht" is not available.
) at /dist/src/php-5.2.8/Zend/zend_hash.c:1086
#1  0x0000002a98a24602 in amf3_serialize_array (buf=0x7fbfff9730, myht=0x2a98e07b88, var_hash=0x7fbfff9770, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/ext/amfext-0.9.2/amf.c:1834
#2  0x0000002a98a251ab in amf3_serialize_var (buf=0x7fbfff9730, struc=0x2a98e07210, var_hash=0x7fbfff9770, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/ext/amfext-0.9.2/amf.c:2027
#3  0x0000002a98a25a39 in amf3_serialize_object_default (buf=0x7fbfff9730, myht=0x2a95aa0948, className=0x2a98c60f48 "flex.messaging.messages.AcknowledgeMessage", classNameLen=Variable "classNameLen" is not available.
)
    at /dist/src/php-5.2.8/ext/amfext-0.9.2/amf.c:1051
#4  0x0000002a98a2574f in amf3_serialize_var (buf=0x7fbfff9730, struc=Variable "struc" is not available.
) at /dist/src/php-5.2.8/ext/amfext-0.9.2/amf.c:1264
#5  0x0000002a98a2726b in zif_amf_encode (ht=Variable "ht" is not available.
) at /dist/src/php-5.2.8/ext/amfext-0.9.2/amf.c:2475
#6  0x00000000006962a6 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fbfffa810, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:200
#7  0x00000000006957d6 in execute (op_array=0x2a98cbfad8, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:92
#8  0x0000000000695ae9 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fbfffacc0, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:234
#9  0x00000000006957d6 in execute (op_array=0xcfb5a0, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:92
#10 0x0000000000695ae9 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fbfffca00, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:234
#11 0x00000000006957d6 in execute (op_array=0x2a95aa83f8, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:92
#12 0x0000000000695ae9 in zend_do_fcall_common_helper_SPEC (execute_data=0x7fbfffd060, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:234
#13 0x00000000006957d6 in execute (op_array=0x2a95a98050, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/Zend/zend_vm_execute.h:92
#14 0x0000000000672d39 in zend_execute_scripts (type=8, tsrm_ls=0xacb090, retval=Variable "retval" is not available.
) at /dist/src/php-5.2.8/Zend/zend.c:1134
#15 0x0000000000627309 in php_execute_script (primary_file=0x7fbffff7f0, tsrm_ls=0xacb090) at /dist/src/php-5.2.8/main/main.c:2023
#16 0x00000000006fa45a in main (argc=2, argv=0x7fbffff948) at /dist/src/php-5.2.8/sapi/cli/php_cli.c:1133

Reproduce code:
---------------
all the other codes is with default configuration of AMFPHP 1.9

the content of ServicesManager.php is

<?php
class ServicesManager{
	
	function __construct()
 	{}
	function __destruct()
	{}
	
	public function UserGetBaseInfo()
	{
	    return array(
	        new TestObjA(),
	        new TestObjB(),
	        new TestObjA(),
	        new TestObjA(),
	        new TestObjB(),
	        new TestObjB(),
	        new TestObjB(),
	    );
	}
}

class TestObjA
{
    public $name;    
    public $_explicitType = 'TestObjA';
}

class TestObjB
{
    public $id;
    public $_explicitType = 'TestObjB';
}  


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-14 08:35 UTC] 200800510 at qq dot com
All the code is based on amfphp 1.9 , i don't know it's a php bug or amfext bug, so i just report this in both place.
 [2009-09-14 09:25 UTC] jani@php.net
Please don't report bugs in some obscure 3rd party extension as PHP bugs. They're 99.99% likely NOT bugs in PHP..
 [2009-09-14 12:01 UTC] 200800510 at qq dot com
Ok, i get it . i report it here just because i see the line "zend_hash_move_forward_ex" ---- it's the core code of php.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 11:01:33 2025 UTC