Menu

#115 [PHP]Segment default will appear when calling cubrid_list_dbs() method

open
nobody
None
5
2012-03-09
2012-03-09
Jira Trac
No

Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
OS: Linux 64
Description:
When no passing parameter to cubrid_list_dbs() method, segment default will appear.

Repro steps:
1. gdb php
2. run list_dbs_test.phpt
3. bt
statement in list_dbs_test.phpt
{noformat}
$conn = cubrid_connect(localhost, 33009, demodb);

$db_list = cubrid_list_dbs($conn);
var_dump($db_list);
//no parameter
$db_list2 = cubrid_list_dbs();
var_dump($db_list2);

cubrid_disconnect($conn);

print Finished!\n;
{noformat}

Actual result:
{noformat}
array(1) {
[0]=
string(6) demodb
}
Segmentation fault
{noformat}

Comments:
{noformat}
[php@NC-PL-QA-013 tests]$ gdb php
...............
(gdb) run list_dbs_test.phpt
Starting program: /home/php/opt/php/bin/php list_dbs_test.phpt
[Thread debugging using libthread_db enabled]
[New Thread 0x2b50829d4670 (LWP 7288)]
array(1) {
[0]=
string(6) demodb
}

{color:red}
Program received signal SIGSEGV, Segmentation fault.
0x000000000067374b in zend_fetch_resource (passed_id=0x7fff280e4f00, default_id=-1, resource_type_name=0x2b508604f500 CUBRID-Connect,
found_resource_type=0x0, num_resource_types=2) at /home/php/install_file/php-5.3.2/Zend/zend_list.c:127
127 } else if ((*passed_id)-type != IS_RESOURCE) {
{color}
(gdb) bt
#0 0x000000000067374b in zend_fetch_resource (passed_id=0x7fff280e4f00, default_id=-1,
resource_type_name=0x2b508604f500 CUBRID-Connect, found_resource_type=0x0, num_resource_types=2)
at /home/php/install_file/php-5.3.2/Zend/zend_list.c:127
#1 0x00002b5086046962 in zif_cubrid_list_dbs (ht=0, return_value=0xbfbbe08, return_value_ptr=value optimized out,
this_ptr=value optimized out, return_value_used=value optimized out) at /home/php/php/trunk/php_cubrid.c:4333
#2 0x00000000006af379 in zend_do_fcall_common_helper_SPEC (execute_data=0x2b5086683050)
at /home/php/install_file/php-5.3.2/Zend/zend_vm_execute.h:313
#3 0x0000000000686e6c in execute (op_array=0xbfbc5b0) at /home/php/install_file/php-5.3.2/Zend/zend_vm_execute.h:104
#4 0x0000000000664cdd in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/php/install_file/php-5.3.2/Zend/zend.c:1194
#5 0x000000000061542d in php_execute_script (primary_file=0x7fff280e7640) at /home/php/install_file/php-5.3.2/main/main.c:2260
#6 0x00000000006e89cc in main (argc=2, argv=0x7fff280e78b8) at /home/php/install_file/php-5.3.2/sapi/cli/php_cli.c:1192
(gdb)
{noformat}

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.