ID:               28728
 Updated by:       [EMAIL PROTECTED]
 Reported By:      steveh at brendata dot co dot uk
 Status:           Wont fix
 Bug Type:         DBX related
 Operating System: linux 2.4.28
 PHP Version:      5.0.4
 New Comment:

Just for the record (the follow-up will continue on pecl)...

The following fixes the crash, but I'm not sure about side-effects so I
won't consider it closed yet, which also means that I won't modify the
dbx_sybasect.c source in cvs just yet. Feedback appreciated at
http://pecl.php.net/bugs/bug.php?id=5398.

Probable fix (verified that it doesn't crash, not tested for
side-effects):

Comment out (or remove) line 198 and 235 in dbx_sybasect.c:

198:    zval_ptr_dtor(zv_name); 
235:    zval_ptr_dtor(zv_type); 

If you're using the source from pecl, the linenumbers are 204 and 242,
respectively.


Previous Comments:
------------------------------------------------------------------------

[2005-09-14 15:14:11] [EMAIL PROTECTED]

Please report bugs in DBX to PECL bug system. (wont fix)


------------------------------------------------------------------------

[2005-09-14 13:14:39] steveh at brendata dot co dot uk

Still seeing the same issue in 5.0.4, could it be my freetds, I'll try
upgrading that, here's teh backtrace:
(gdb) bt
#0  0x0829700b in _zval_ptr_dtor (zval_ptr=0x8919e48,
__zend_filename=0x82eade0 "/usr/src/php-5.0.4/ext/dbx/dbx_sybasect.c",

    __zend_lineno=198) at
/usr/src/php-5.0.4/Zend/zend_execute_API.c:390
#1  0x080b958a in dbx_sybasect_getcolumnname (rv=0xbfffc944,
result_handle=0xbfffc97c, column_index=0, ht=2, 
    return_value=0x86618d4, this_ptr=0x0, return_value_used=1) at
/usr/src/php-5.0.4/ext/dbx/dbx_sybasect.c:198
#2  0x080b3acd in switch_dbx_getcolumnname (rv=0xbfffc944,
result_handle=0xbfffc97c, column_index=0, ht=2, return_value=0x86618d4,

    this_ptr=0x0, return_value_used=1, dbx_module=0x8919188) at
/usr/src/php-5.0.4/ext/dbx/dbx.c:915
#3  0x080b1f74 in zif_dbx_query (ht=2, return_value=0x86618d4,
this_ptr=0x0, return_value_used=1)
    at /usr/src/php-5.0.4/ext/dbx/dbx.c:492
#4  0x082cb726 in zend_do_fcall_common_helper (execute_data=0xbfffd0b0,
opline=0x867b11c, op_array=0x8679850)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2727
#5  0x082cbd76 in zend_do_fcall_handler (execute_data=0xbfffd0b0,
opline=0x867b11c, op_array=0x8679850)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2859
#6  0x082c8541 in execute (op_array=0x8679850) at
/usr/src/php-5.0.4/Zend/zend_execute.c:1406
#7  0x082cb880 in zend_do_fcall_common_helper (execute_data=0xbfffd6b0,
opline=0x8613578, op_array=0x860b87c)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2756
#8  0x082cbc93 in zend_do_fcall_by_name_handler
(execute_data=0xbfffd6b0, opline=0x8613578, op_array=0x860b87c)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2841
#9  0x082c8541 in execute (op_array=0x860b87c) at
/usr/src/php-5.0.4/Zend/zend_execute.c:1406
#10 0x082a3bcf in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php-5.0.4/Zend/zend.c:1069
#11 0x082624f8 in php_execute_script (primary_file=0xbffffab0) at
/usr/src/php-5.0.4/main/main.c:1632
#12 0x082dcf24 in main (argc=7, argv=0xbffffb54) at
/usr/src/php-5.0.4/sapi/cli/php_cli.c:946
#13 0x405d2657 in __libc_start_main (main=0x82dc3ec <main>, argc=7,
ubp_av=0xbffffb54, init=0x808d86c <_init>, 
    fini=0x82e2f80 <_fini>, rtld_fini=0x4000dc54 <_dl_fini>,
stack_end=0xbffffb4c) at ../sysdeps/generic/libc-start.c:129
(gdb) 
#0  0x0829700b in _zval_ptr_dtor (zval_ptr=0x8919e48,
__zend_filename=0x82eade0 "/usr/src/php-5.0.4/ext/dbx/dbx_sybasect.c",

    __zend_lineno=198) at
/usr/src/php-5.0.4/Zend/zend_execute_API.c:390
#1  0x080b958a in dbx_sybasect_getcolumnname (rv=0xbfffc944,
result_handle=0xbfffc97c, column_index=0, ht=2, 
    return_value=0x86618d4, this_ptr=0x0, return_value_used=1) at
/usr/src/php-5.0.4/ext/dbx/dbx_sybasect.c:198
#2  0x080b3acd in switch_dbx_getcolumnname (rv=0xbfffc944,
result_handle=0xbfffc97c, column_index=0, ht=2, return_value=0x86618d4,

    this_ptr=0x0, return_value_used=1, dbx_module=0x8919188) at
/usr/src/php-5.0.4/ext/dbx/dbx.c:915
#3  0x080b1f74 in zif_dbx_query (ht=2, return_value=0x86618d4,
this_ptr=0x0, return_value_used=1)
    at /usr/src/php-5.0.4/ext/dbx/dbx.c:492
#4  0x082cb726 in zend_do_fcall_common_helper (execute_data=0xbfffd0b0,
opline=0x867b11c, op_array=0x8679850)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2727
#5  0x082cbd76 in zend_do_fcall_handler (execute_data=0xbfffd0b0,
opline=0x867b11c, op_array=0x8679850)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2859
#6  0x082c8541 in execute (op_array=0x8679850) at
/usr/src/php-5.0.4/Zend/zend_execute.c:1406
#7  0x082cb880 in zend_do_fcall_common_helper (execute_data=0xbfffd6b0,
opline=0x8613578, op_array=0x860b87c)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2756
#8  0x082cbc93 in zend_do_fcall_by_name_handler
(execute_data=0xbfffd6b0, opline=0x8613578, op_array=0x860b87c)
    at /usr/src/php-5.0.4/Zend/zend_execute.c:2841
#9  0x082c8541 in execute (op_array=0x860b87c) at
/usr/src/php-5.0.4/Zend/zend_execute.c:1406
#10 0x082a3bcf in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php-5.0.4/Zend/zend.c:1069
#11 0x082624f8 in php_execute_script (primary_file=0xbffffab0) at
/usr/src/php-5.0.4/main/main.c:1632
#12 0x082dcf24 in main (argc=7, argv=0xbffffb54) at
/usr/src/php-5.0.4/sapi/cli/php_cli.c:946
#13 0x405d2657 in __libc_start_main (main=0x82dc3ec <main>, argc=7,
ubp_av=0xbffffb54, init=0x808d86c <_init>, 
    fini=0x82e2f80 <_fini>, rtld_fini=0x4000dc54 <_dl_fini>,
stack_end=0xbffffb4c) at ../sysdeps/generic/libc-start.c:129
(gdb)

------------------------------------------------------------------------

[2005-02-03 05:34:52] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2004-06-14 12:55:05] steveh at brendata dot co dot uk

Ok, I've upgraded freetds to 0.62.4
>From the SQL Profiler I can see that the use and the select is being
executed on the SQL server.
I've successfully run tests using the tsql utility provided with
freetds, I'm now at a bit of a loss as to what else to test, it looks
like a fairly basic failure?

The major difference is that this server is sql2000, whereas our
production bugs server is sql6.5(!)

------------------------------------------------------------------------

[2004-06-14 12:16:49] steveh at brendata dot co dot uk

Here's code that reproduces the issue along with the definition of the
table (the table is currently empty).

<?php

function zsql_query($Sql)
{
$Link=dbx_connect(DBX_SYBASECT, "SALESTRACK", "SalesTracking", "sa",
"password", DBX_PERSISTENT);
$Result=dbx_query($Link,$Sql);
dbx_close($Link);
Return $Result;
}

function
zdropdown($Variable,$QueryString,$Selected,$ExtraName="",$ExtraValue="",$SortColumn=2)
{
$Ret="";
$Result=zsql_query($QueryString." order by $SortColumn asc");

return $Ret;
}
echo zdropdown("dCM__DefaultInvoice_tblAddressID","select ID,Name from
tblAddress",$dCM__DefaultInvoice_tblAddressID," ",-1);
?>

I'm going to run some tests on freetds to make sure this isn't a
freetds bug.

------------------------------------------------------------------------

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/28728

-- 
Edit this bug report at http://bugs.php.net/?id=28728&edit=1

Reply via email to