php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11099 name conflict imap vs. sybase
Submitted: 2001-05-24 17:07 UTC Modified: 2001-05-25 10:21 UTC
From: mheumann at sei dot cl Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.0.5 OS: Linux Mandrake 8.0
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: mheumann at sei dot cl
New email:
PHP Version: OS:

 

 [2001-05-24 17:07 UTC] mheumann at sei dot cl
Hi, 
I just discovered a name conflict between the sybase library and the imap library that may be linked into php4.  
When executing this script through apache:

<html> 
<head><title>Mail Test</title></head> 
<body> 
<?php 
 $host = "mail.host.tld/pop3"; 
 $mbox = imap_open ("\{$host:110}INBOX", "test", "test"); 
 $aHeaders = imap_headers( $mbox ); 
 while( list( $Key, $Val ) = each( $aHeaders ) ) 
   echo $Val . "<br>"; 
 imap_close( $mbox ); 
?> 
</body> 
</html> 

The effect is the following error message in the browser:

Warning: Couldn't open stream {mail.host.tld/pop3:110}INBOX in
/usr/data/htdocs/intranet/mail.php on line 6

 Warning: Unable to find stream pointer in
 /usr/data/htdocs/intranet/mail.php on line 7
 Warning: Variable passed to
 each() is not an array or object in /usr/data/htdocs/intranet/mail.php on
 line 8
 Warning: Unable to find stream pointer in
 /usr/data/htdocs/intranet/mail.php on line 10

Also, Apache displays a segmentation fault (11) in its error log.

gdb backtrace:

[root@lxbox sbin]# gdb /usr/sbin/httpd
GNU gdb 5.0mdk-11mdk Linux-Mandrake 8.0
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mandrake-linux"...
(gdb) run -X
Starting program: /usr/sbin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
0x403899d3 in tcp_open () from /opt/sybase-11.9.2/lib/libsybdb.so
(gdb) bt
#0  0x403899d3 in tcp_open () from /opt/sybase-11.9.2/lib/libsybdb.so
#1  0x4058c96c in net_open_work (dv=0x40691ae0, host=0xbfffce20 "mail.sei.cl",
    service=0xbfffd1a2 "pop3", port=110, portoverride=110, flags=0)
    at mail.c:5514
#2  0x4058ac60 in net_open (mb=0xbfffce20, dv=0x0, port=110, ssld=0x0,
    ssls=0x4067aa44 "*pop3s", sslp=995) at mail.c:5485
#3  0x405aedde in pop3_open (stream=0x8259240) at pop3.c:328
#4  0x4058150d in mail_open (stream=0x0,
    name=0x837c2bc "{mail.sei.cl/pop3:110}INBOX", options=0) at mail.c:1022
#5  0x404c818d in imap_do_open (ht=4, return_value=0x838036c, this_ptr=0x0,
    return_value_used=1, persistent=0) at php_imap.c:810
#6  0x404c82b9 in php_if_imap_open (ht=4, return_value=0x838036c,
    this_ptr=0x0, return_value_used=1) at php_imap.c:838
#7  0x404836c1 in execute (op_array=0x8198904) at ./zend_execute.c:1494
#8  0x4049457d in zend_execute_scripts (type=8, file_count=3) at zend.c:743
#9  0x404ac3bc in php_execute_script (primary_file=0xbffff7c0) at main.c:1209
#10 0x404a7b15 in apache_php_module_main (r=0x8141e94, display_source_mode=0)
    at sapi_apache.c:89
#11 0x404a87ec in send_php (r=0x8141e94, display_source_mode=0,
    filename=0x814288c "/usr/data/htdocs/intranet/mail.php") at mod_php4.c:521
#12 0x404a8832 in send_parsed_php (r=0x8141e94) at mod_php4.c:532
#13 0x0806b8b7 in ap_invoke_handler ()
#14 0x080803bb in process_request_internal ()
#15 0x08080430 in ap_process_request ()
#16 0x080774d2 in child_main ()
#17 0x08077684 in make_child ()
#18 0x080777f8 in startup_children ()
#19 0x08077e77 in standalone_main ()
#20 0x080786af in main ()
#21 0x400910de in __libc_start_main () from /lib/libc.so.6

I use apache 1.3.20, PHP 4.0.5, the IMAP snapshot from a couple of days ago and I configured PHP like this: 

'./configure' '--with-apxs=/usr/sbin/apxs' '--with-gd=yes'
'--with-xpm-dir' '--with-jpeg-dir=/usr/local' '--with-
ttf=/usr/src/freetype-1.3.1' '--with-zlib' '--with-xml' '--with-ftp''--with-mcal=../libmcal' '--with-imap' '--with- sybase=/opt/sybase-11.9.2''--with-mysql=/usr' '--with-mcrypt=/usr/local' '--with-mhash''--with-config-file- path=/etc/httpd/conf' '--enable-versioning''--enable-track-vars''--enable-debug'

according to phpinfo(). 

It is clear that the problem lies in the naming conflict of the tcp_open function (and maybe others) that is defined both by the sybase library libsybdb.so and the c-client library used in imap.  Please try to agree on different function names. I momentarily renamed the functions used by imap.

Thanks.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-25 10:21 UTC] sniper@php.net
This is not any bug in PHP but in the sybase libs.
Update them. I'm running 11.9.2 with the patches (9223?)

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 20:01:30 2024 UTC