PHP 4.0 Bug #3803: php segfaults on reading image column from sybase 11.0.3.3
| From: | k at les dot cz | Date: | Fri, 10 Mar 2000 20:42:35 +0000 |
| Subject: | PHP 4.0 Bug #3803: php segfaults on reading image column from sybase 11.0.3.3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16668@lists.php.net to get a copy of this message | ||
From: k@les.cz
Operating system: RedHat Linux 6.1, kernel 2.2.12, glibc 2.1.3-6,
PHP version: 4.0 Latest CVS (10/03/2000)
PHP Bug Type: Sybase (dblib) related
Bug description: php segfaults on reading image column from sybase 11.0.3.3
table:
create table modul_obrazek (
id numeric(7,0) identity,
nazvy char(10),
image IMAGE,
primary key (id)
)
php script:
<?php
$link = sybase_pconnect('','sa','');
sybase_select_db('mydb', $link);
$query= "SELECT nazvy,image
FROM modul_obrazek WHERE id=9";
$res = sybase_query($query, $link);
$row = sybase_fetch_row($res);
echo "$row[0]";
?>
gdb says:
(gdb) bt
#0 0x400a2402 in com_prhex () from /opt/sybase//lib/libsybdb.so
#1 0x400a249f in com__bin2hex () from /opt/sybase//lib/libsybdb.so
#2 0x4009afa5 in com_bintontbstring () from /opt/sybase//lib/libsybdb.so
#3 0x400562f9 in db__convertfunc () from /opt/sybase//lib/libsybdb.so
#4 0x40056153 in dbbconvert () from /opt/sybase//lib/libsybdb.so
#5 0x40055f31 in dbconvert_ps () from /opt/sybase//lib/libsybdb.so
#6 0x40055f71 in dbconvert () from /opt/sybase//lib/libsybdb.so
#7 0x80eb920 in php_sybase_get_column_content (sybase_ptr=0x41ce4ff4,
offset=2, result=0x41c75ff0, column_type=34) at sybase.c:636
#8 0x80ebd5c in php_if_sybase_query (ht=1, return_value=0x41c5eff0,
this_ptr=0x0, return_value_used=1) at sybase.c:740
#9 0x80ff94d in execute (op_array=0x41c51fb0) at ./zend_execute.c:1598
#10 0x807d0ff in php_execute_script (primary_file=0xbffffb8c) at main.c:1147
#11 0x80a0599 in apache_php_module_main (r=0x40e74028, fd=19,
display_source_mode=0) at sapi_apache.c:88
#12 0x807878b in send_php (r=0x40e74028, display_source_mode=0,
filename=0x40e74b30 "/home/tomucha/public_html/casopis/jacek2.php")
at mod_php4.c:491
#13 0x80787cc in send_parsed_php (r=0x40e74028) at mod_php4.c:503
#14 0x81262d3 in ap_invoke_handler (r=0x40e74028) at http_config.c:508
#15 0x81397b9 in process_request_internal (r=0x40e74028) at http_request.c:1215
#16 0x813981c in ap_process_request (r=0x40e74028) at http_request.c:1231
#17 0x81310fe in child_main (child_num_arg=0) at http_main.c:4177
#18 0x813133c in make_child (s=0x4025f028, slot=0, now=952719137)
at http_main.c:4336
#19 0x81313e9 in startup_children (number_to_start=2) at http_main.c:4363
#20 0x8131a16 in standalone_main (argc=1, argv=0xbffffd44) at http_main.c:4651
#21 0x81321a3 in main (argc=1, argv=0xbffffd44) at http_main.c:4978
I'm using apache 1.3.12, php is compiled as a static module. Apache was linked with
ElectricFence.
The same query works ok if sent from isql client.