php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7697 Crash at sybase_close
Submitted: 2000-11-08 13:08 UTC Modified: 2000-12-06 21:47 UTC
From: j at rsi dot pl Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.0.3pl1 OS: Linux RedHat 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: j at rsi dot pl
New email:
PHP Version: OS:

 

 [2000-11-08 13:08 UTC] j at rsi dot pl
  The problem exist when PHP is compiled with SybaseCT 11.0.3.3 ESD#6 (lower ESD also) AND (important!) IMAP support.
  When sybase_close() function is called (directly or automaticaly at PHP destructors) php segfaults with core.

--------

Script 'crash.php':

<?php
$link = sybase_connect("SERVER", "username", "password");
sybase_close($link);
?>

--------

php.ini (exceptions):

magic_quotes_sybase     =       On

[Sybase]
sybase.allow_persistent =       On
sybase.max_persistent   =       -1
sybase.max_links        =       -1
sybase.interface_file   =       "/opt/sybase/interfaces"
sybase.min_error_severity       =       11
sybase.min_message_severity     =       11
sybase.compatability_mode       = Off

[Sybase-CT]
sybct.allow_persistent  =       On
sybct.max_persistent    =       -1
sybct.max_links         =       -1
sybct.min_server_severity       =       11
sybct.min_client_severity       =       11

--------

Sybase compiled as minimum CGI:
./configure \
  --prefix=/usr \
  --disable-force-cgi-redirect \
  --with-config-file-path=/etc \
  --disable-debug \
  --disable-magic-quotes \
  --with-exec-dir=/usr/bin \
  --disable-safe-mode \
  --disable-short-tags \
  --disable-ftp \
  --without-mhash \
  --without-mcrypt \
  --without-gd \
  --disable-dbase \
  --disable-calendar \
  --disable-bcmath \
  --without-xml \
  --without-swf \
  --without-png \
  --without-pspell \
  --without-curl \
  --disable-sysvsem \
  --disable-sysvshm \
  --without-mm \
  --without-t1lib \
  --disable-sockets \
  --disable-exif \
  --without-gdbm \
  --disable-memory-limit \
  --disable-trans-sid \
  --without-dom \
  --disable-shmop \
  --disable-track-vars \
  --without-ttf \
  --without-tsrm-pthreads \
  --with-imap \
  --with-sybase-ct=/opt/sybase
make

--------

# ldd php
        libpam.so.0 => /lib/libpam.so.0 (0x40019000)
        libimap.so.4 => /usr/lib/libimap.so.4 (0x40021000)
        libdl.so.2 => /lib/libdl.so.2 (0x400d0000)
        libinsck.so => /opt/sybase/lib/libinsck.so (0x400d4000)
        libsybtcl.so => /opt/sybase/lib/libsybtcl.so (0x400d8000)
        libintl.so => /opt/sybase/lib/libintl.so (0x400ea000)
        libcomn.so => /opt/sybase/lib/libcomn.so (0x400f3000)
        libct.so => /opt/sybase/lib/libct.so (0x40138000)
        libcs.so => /opt/sybase/lib/libcs.so (0x40183000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x4018f000)
        libm.so.6 => /lib/libm.so.6 (0x4019f000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x401bc000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x401ea000)
        libc.so.6 => /lib/libc.so.6 (0x40200000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

--------

Backtrace follows:

# gdb php core
(...cut some startup info...)
#0  0x4004b66b in net_close (stream=0x81755a0) at mail.c:5572
#1  0x401493f1 in np_io_close () from /opt/sybase/lib/libct.so
#2  0x40152acb in ct__tds_closeconn () from /opt/sybase/lib/libct.so
#3  0x40116ae9 in com__async_runstack () from /opt/sybase/lib/libcomn.so
#4  0x401169d9 in com__async_poll_state () from /opt/sybase/lib/libcomn.so
#5  0x401167f7 in com__async_do_poll () from /opt/sybase/lib/libcomn.so
#6  0x40116403 in com_async_poll () from /opt/sybase/lib/libcomn.so
#7  0x4015ad6a in ct__api_async () from /opt/sybase/lib/libct.so
#8  0x4015d44d in ct_close () from /opt/sybase/lib/libct.so
#9  0x80d9843 in _close_sybase_link (sybase_ptr=0x8161a34)
    at php_sybase_ct.c:152
#10 0x80f50f7 in list_entry_destructor (ptr=0x819de84) at zend_list.c:253
#11 0x80f32c9 in zend_hash_del_key_or_index (ht=0x816060c, arKey=0x0,
    nKeyLength=0, h=1, flag=1) at zend_hash.c:535
#12 0x80f54af in zend_list_do_delete (list=0x816060c, id=1) at
zend_list.c:59
#13 0x80f4e55 in zend_list_delete (id=1) at zend_list.c:118
#14 0x80edeab in _zval_dtor (zvalue=0x8199ecc,
    __zend_filename=0x812de9c "zend_execute_API.c", __zend_lineno=261)
    at zend_variables.c:80
#15 0x80e5055 in _zval_ptr_dtor (zval_ptr=0x81991b4,
    __zend_filename=0x8141940 "zend_execute.h", __zend_lineno=114)
    at zend_execute_API.c:261
#16 0x8116964 in zend_ptr_stack_clear_multiple () at zend_execute.h:114
#17 0x8113fdb in execute (op_array=0x8199e04) at ./zend_execute.c:1593
#18 0x80ef1cb in zend_execute_scripts (type=8, file_count=3) at zend.c:717
#19 0x806059c in php_execute_script (primary_file=0xbffffc90) at main.c:1200
#20 0x805e6d9 in main (argc=2, argv=0xbffffd04) at cgi_main.c:715

--------

Closer look at /usr/include/imap/mail.h shows:
void net_close (NETSTREAM *stream);

But why is it called by libct.so?

Note: when PHP is compiled with either IMAP _or_ SybaseCT it works fine. The problem arises _only_ when those features are used _both_ at the same time.

Any ideas?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-06 21:47 UTC] joey@php.net
This is a collision between symbols in Sybase CT
libraries and IMAP library. PHP has nothing to do
with it.

Upgrade your sybase libraries to the 11.1.1 or later
release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC