php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4137 fsockopen causes the script to stall
Submitted: 2000-04-13 14:18 UTC Modified: 2005-03-31 16:13 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: leao at awa dot com dot br Assigned:
Status: Wont fix Package: Misbehaving function
PHP Version: 3.0.16 OS: AIX 4.2
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: leao at awa dot com dot br
New email:
PHP Version: OS:

 

 [2000-04-13 14:18 UTC] leao at awa dot com dot br
The scripts stalls on the fsockopen function, if the function is commented out or removed the scripts works perfectly.

The scripts works entirely in others instalation (2 WinNT 4.2 Apache 1.3.9, PHP 3.0.15 (CGI) and 2 Linux RedHat Apache 1.3.9 with mod_php3).

I tried with Gcc and with Xlc.

It'd kinda really be helpful to get this fixed quick. 10 months ago i convinced some peoples to use PHP for this project and now the 2 most important clients, with AIX, can't use the application.

I'd be very thankful for an answer.

Marcos Leao

About fsock.c:
==============
/* $Id: fsock.c,v 1.135 2000/01/01 04:31:15 sas Exp $ */

196: if(FD_ISSET(sockfd, &rset) || FD_ISSET(sockfd, &wset)) {
197: 	len = sizeof(error);
198: 		/* 
199: 	   BSD-derived systems set errno correctly
200: 	   Solaris returns -1 from getsockopt in case of error
201: 	 */
202: 	if(getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &error, &len) < 0)
203: 		ret = -1;
204: } else {
205: 	/* whoops: sockfd has disappeared */
206: 	ret = -1;
207: 	}


========================================================
Witch CGG 2.95.1:
=================

./configure --with-gd=no --enable-debug=no --with-exec-dir=/usr/local/apache/cgi-bin --enable-track-vars=yes --enable-magic-quotes=yes --bindir=/usr/local/apache/cgi-bin
creating cache ./config.cache
checking whether build environment is sane... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for bison... bison -y
checking bison version... 1.28 (ok)
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for ranlib... ranlib
checking whether gcc and cc understand -c and -o together... 
checking whether ln -s works... yes
checking for perl... no
checking for sh... /usr/bin/sh
checking for working const... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking if compiler supports -Wl,--version-script... yes
checking size of long... 4
checking size of int... 4
checking for sendmail... /usr/sbin/sendmail
checking for gethostent... yes
checking for socket in -lc... yes
checking for gethostbyaddr in -lc... yes
checking for crypt in -lc... yes
checking for dlopen in -lc... no
checking for dlopen in -ldl... yes
checking for sin in -lc... no
checking for sin in -lm... yes
checking for res_search in -lsocket... no
checking for res_search in -lresolv... no
checking for dn_skipname in -lresolv... no
checking for __dn_skipname in -lresolv... no
checking for pam_start in -lpam... no
checking for inet_aton in -lbind... yes
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... n
checking for fclose declaration... ok
checking for fcntl.h... yes
checking for unistd.h... yes
checking for crypt.h... yes
checking for sys/file.h... yes
checking for memory.h... yes
checking for pwd.h... yes
checking for grp.h... yes
checking for sys/socket.h... yes
checking for sys/wait.h... yes
checking for syslog.h... yes
checking for string.h... yes
checking for sys/varargs.h... no
checking for stdarg.h... yes
checking for sys/resource.h... yes
checking for sys/time.h... yes
checking for signal.h... yes
checking for netinet/in.h... yes
checking for dlfcn.h... yes
checking for limits.h... yes
checking for sys/types.h... yes
checking for sys/statvfs.h... yes
checking for sys/statfs.h... yes
checking for unix.h... no
checking for db.h... no
checking for dbm.h... yes
checking for ndbm.h... yes
checking for db1/ndbm.h... no
checking for locale.h... yes
checking for features.h... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... no
checking for tzname... yes
checking for tm_gmtoff in struct tm... no
checking for struct flock... yes
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for uint... yes
checking for ushort... yes
checking for ulong... yes
checking for ptrdiff_t... yes
checking for vprintf... yes
checking for memcpy... yes
checking for memmove... yes
checking for strdup... yes
checking for strerror... yes
checking for strcasecmp... yes
checking for strstr... yes
checking for flock... no
checking for lockf... yes
checking for putenv... yes
checking for tempnam... yes
checking for usleep... yes
checking for setlocale... yes
checking for gettimeofday... yes
checking for setvbuf... yes
checking for srand48... yes
checking for lrand48... yes
checking for srandom... yes
checking for random... yes
checking for link... yes
checking for symlink... yes
checking for regcomp... yes
checking for getlogin... yes
checking for cuserid... yes
checking for vsnprintf... yes
checking for gcvt... yes
checking for utime... yes
checking for crypt... yes
checking for setitimer... yes
checking for rint... yes
checking for unsetenv... no
checking for strftime... yes
checking for setsockopt... yes
checking for tzset... yes
checking for statvfs... yes
checking for statfs... yes
checking for inet_aton... yes
checking for shutdown... yes
checking for truncate... yes
checking for getpgid... yes
checking for getsid... yes
checking for getrlimit... yes
checking for snprintf... yes
checking for ctermid... yes
checking for setsid... yes
checking for mkfifo... yes
checking for getrusage... yes
checking whether utime accepts a null argument... yes
checking for working alloca.h... no
checking for alloca... yes
checking for broken sprintf... ok
checking for getopt... yes
checking for declared timezone... yes
checking for standard DES crypt... yes
checking for extended DES crypt... no
checking for MD5 crypt... no
checking for Blowfish crypt... no
checking for Apache module support via DSO through APXS... no
checking whether to enable versioning... no
checking for Apache module support... no
checking whether to use bundled regex library... yes
checking for gdbm_open in -lgdbm... no
checking for dbm_open in -ldb... no
checking for dbm_open in -lc... yes
checking preferred dbm library... ndbm chosen
checking for mod_charset compatibility option... no
...
...
...
gcc -O2 -O2   -I. -I.                        -c functions/filestat.c -o functions/filestat.o
gcc -O2 -O2   -I. -I.                        -c functions/formatted_print.c -o functions/formatted_print.o
gcc -O2 -O2   -I. -I.                        -c functions/fsock.c -o functions/fsock.o
functions/fsock.c: In function `connect_nonb':
functions/fsock.c:202: warning: passing arg 5 of `getsockopt' from incompatible pointer type
gcc -O2 -O2   -I. -I.                        -c functions/gd.c -o functions/gd.o
gcc -O2 -O2   -I. -I.                        -c functions/head.c -o functions/head.o
gcc -O2 -O2   -I. -I.                        -c functions/html.c -o functions/html.o
gcc -O2 -O2   -I. -I.                        -c functions/image.c -o functions/image.o
gcc -O2 -O2   -I. -I.                        -c functions/imap.c -o functions/imap.o
gcc -O2 -O2   -I. -I.                        -c functions/php3_mcal.c -o functions/ph
...
...
...
=========================================================

Witch Xlc:
==========

/configure --with-gd=no --enable-debug=no --with-exec-dir=/usr/local/apache/cgi-bin --enable-track-vars=yes --enable-magic-quotes=yes --bindir=/usr/local/apache/cgi-bin
creating cache ./config.cache
checking whether build environment is sane... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for bison... no
checking for byacc... no
configure: warning: You will need bison if you'd want to regenerate the PHP 3.0 parsers.
checking for gcc... no
checking for cc... cc
checking whether the C compiler (cc  ) works... yes
checking whether the C compiler (cc  ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking for ranlib... ranlib
checking whether cc understands -c and -o together... yes
checking whether ln -s works... yes
checking for perl... /usr/bin/perl
checking for sh... /usr/bin/sh
checking for sh... /usr/bin/sh
checking for working const... yes
checking if compiler supports -R... yes
checking if compiler supports -Wl,--version-script... no
checking size of long... 4
checking size of int... 4
checking for sendmail... /usr/sbin/sendmail
checking for gethostent... yes
checking for socket in -lc... yes
checking for gethostbyaddr in -lc... yes
checking for crypt in -lc... yes
checking for dlopen in -lc... no
checking for dlopen in -ldl... yes
checking for sin in -lc... no
checking for sin in -lm... yes
checking for res_search in -lsocket... no
checking for res_search in -lresolv... no
checking for dn_skipname in -lresolv... no
checking for __dn_skipname in -lresolv... no
checking for pam_start in -lpam... no
checking for inet_aton in -lbind... yes
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for fclose declaration... ok
checking for fcntl.h... yes
checking for unistd.h... yes
checking for crypt.h... yes
checking for sys/file.h... yes
checking for memory.h... yes
checking for pwd.h... yes
checking for grp.h... yes
checking for sys/socket.h... yes
checking for sys/wait.h... yes
checking for syslog.h... yes
checking for string.h... yes
checking for sys/varargs.h... no
checking for stdarg.h... yes
checking for sys/resource.h... yes
checking for sys/time.h... yes
checking for signal.h... yes
checking for netinet/in.h... yes
checking for dlfcn.h... yes
checking for limits.h... yes
checking for sys/types.h... yes
checking for sys/statvfs.h... yes
checking for sys/statfs.h... yes
checking for unix.h... no
checking for db.h... no
checking for dbm.h... yes
checking for ndbm.h... yes
checking for db1/ndbm.h... no
checking for locale.h... yes
checking for features.h... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for tm_zone in struct tm... no
checking for tzname... yes
checking for tm_gmtoff in struct tm... no
checking for struct flock... yes
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking for size_t... yes
checking for uid_t in sys/types.h... yes
checking for uint... yes
checking for ushort... yes
checking for ulong... yes
checking for ptrdiff_t... yes
checking for vprintf... yes
checking for memcpy... yes
checking for memmove... yes
checking for strdup... yes
checking for strerror... yes
checking for strcasecmp... yes
checking for strstr... yes
checking for flock... no
checking for lockf... yes
checking for putenv... yes
checking for tempnam... yes
checking for usleep... yes
checking for setlocale... yes
checking for gettimeofday... yes
checking for setvbuf... yes
checking for srand48... yes
checking for lrand48... yes
checking for srandom... yes
checking for random... yes
checking for link... yes
checking for symlink... yes
checking for regcomp... yes
checking for getlogin... yes
checking for cuserid... yes
checking for vsnprintf... yes
checking for gcvt... yes
checking for utime... yes
checking for crypt... yes
checking for setitimer... yes
checking for rint... yes
...
...
...
#make install
        cc -g   -I. -I.                        -c language-parser.tab.c -o language-parser.tab.o
        cc -g   -I. -I.                        -w -DYY_USE_CONST -c language-scanner.c
        cc -g   -I. -I.                        -c main.c -o main.o
        cc -g   -I. -I.                        -c php3_hash.c -o php3_hash.o
        cc -g   -I. -I.                        -c operators.c -o operators.o
        cc -g   -I. -I.                        -c variables.c -o variables.o
        cc -g   -I. -I.                        -c token_cache.c -o token_cache.o
        cc -g   -I. -I.                        -c stack.c -o stack.o
        cc -g   -I. -I.                        -c internal_functions.c -o internal_functions.o
...
...
...
        cc -g   -I. -I.                        -c stack.c -o stack.o
        cc -g   -I. -I.                        -c internal_functions.c -o internal_functions.o
        cc -g   -I. -I.                        -c snprintf.c -o snprintf.o
"snprintf.c", line 937.69: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c php3_sprintf.c -o php3_sprintf.o
        cc -g   -I. -I.                        -c alloc.c -o alloc.o
        cc -g   -I. -I.                        -c list.c -o list.o
        cc -g   -I. -I.                        -c highlight.c -o highlight.o
        cc -g   -I. -I.                        -c debugger.c -o debugger.o
        cc -g   -I. -I.                        -c configuration-parser.tab.c -o configuration-parser.tab.o
        cc -g   -I. -I.                        -w -DYY_USE_CONST -c configuration-scanner.c
        cc -g   -I. -I.                        -c request_info.c -o request_info.o
        cc -g   -I. -I.                        -c safe_mode.c -o safe_mode.o
        cc -g   -I. -I.                        -c fopen-wrappers.c -o fopen-wrappers.o
...
...
...
        cc -g   -I. -I.                        -c safe_mode.c -o safe_mode.o
        cc -g   -I. -I.                        -c fopen-wrappers.c -o fopen-wrappers.o
        cc -g   -I. -I.                        -c constants.c -o constants.o
        cc -g   -I. -I.                        -c php3_realpath.c -o php3_realpath.o
        cc -g   -I. -I.                        -c alloca.c -o alloca.o
"alloca.c", line 492.25: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c php_compat.c -o php_compat.o
        cc -g   -I. -I.                        -c functions/adabasd.c -o functions/adabasd.o
        cc -g   -I. -I.                        -c functions/aspell.c -o functions/aspell.o
        cc -g   -I. -I.                        -c functions/apache.c -o functions/apache.o
        cc -g   -I. -I.                        -c functions/fhttpd.c -o functions/fhttpd.o
        cc -g   -I. -I.                        -c functions/basic_functions.c -o functions/basic_functions.o
        cc -g   -I. -I.                        -c functions/crypt.c -o functions/crypt.o
        cc -g   -I. -I.                        -c functions/datetime.c -o functions/datetime.o
        cc -g   -I. -I.                        -c functions/db.c -o functions/db.o
        cc -g   -I. -I.           
...
...
...
        cc -g   -I. -I.                        -c functions/exec.c -o functions/exec.o
        cc -g   -I. -I.                        -c functions/file.c -o functions/file.o
        cc -g   -I. -I.                        -c functions/filepro.c -o functions/filepro.o
        cc -g   -I. -I.                        -c functions/filestat.c -o functions/filestat.o
        cc -g   -I. -I.                        -c functions/formatted_print.c -o functions/formatted_print.o
        cc -g   -I. -I.                        -c functions/fsock.c -o functions/fsock.o
"functions/fsock.c", line 202.69: 1506-280 (W) Function argument assignment between types "unsigned long*" and "int*" is not allowed.
        cc -g   -I. -I.                        -c functions/gd.c -o functions/gd.o
        cc -g   -I. -I.                        -c functions/head.c -o functions/head.o
        cc -g   -I. -I.                        -c functions/html.c -o functions/html.o
        cc -g   -I. -I.                        -c functions/image.c -o functions/image.o
        cc -g   -I. -I.                        -c functions/imap.c -o functions/imap.o
        cc -g   -I. -I.                        -c functions/php3_mcal.c -o functions/php3_mcal.o
        cc -g   -I. -I.                        -c functions/php_ftp.c -o functions/php_ftp.o
...
...
...
        cc -g   -I. -I.                        -c functions/gdcache.c -o functions/gdcache.o
"functions/gdcache.c", line 201.42: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c functions/zlib.c -o functions/zlib.o
        cc -g   -I. -I.                        -c functions/COM.c -o functions/COM.o
"functions/COM.c", line 511.4: 1506-356 (W) Compilation unit is empty.
        touch functions/ifx.c
        cc -g   -I. -I.                        -c functions/ifx.c -o functions/ifx.o
"functions/ifx.c", line 1: 1506-229 (W) File is empty.
"functions/ifx.c", line 1.1: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c functions/pdf.c -o functions/pdf.o
        cc -g   -I. -I.                        -c functions/cpdf.c -o functions/cpdf.o
        cc -g   -I. -I.                        -c functions/hw.c -o functions/hw.o
        cc -g   -I. -I.                        -c functions/hg_comm.c -o functions/hg_comm.o
        cc -g   -I. -I.                        -c functions/dlist.c -o functions/dlist.o
"functions/dlist.c", line 407.7: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c functions/fdf.c -o functions/fdf.o
        cc -g   -I. -I.                   
...
...
...
        cc -g   -I. -I.                        -c functions/sysvsem.c -o functions/sysvsem.o
"functions/sysvsem.c", line 374.4: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c functions/dav.c -o functions/dav.o
        cc -g   -I. -I.                        -c functions/sysvshm.c -o functions/sysvshm.o
"functions/sysvshm.c", line 484.4: 1506-356 (W) Compilation unit is empty.
        cc -g   -I. -I.                        -c functions/gettext.c -o functions/gettext.o
        cc -g   -I. -I.                        -c functions/php3_mckcrypt.c -o functions/php3_mckcrypt.o
        cc -g   -I. -I.                        -c functions/yp.c -o functions/yp.o
        cc -g   -I. -I.                        -c functions/dba.c -o functions/dba.o
        cc -g   -I. -I.                        -c functions/dba_gdbm.c -o functions/dba_gdbm.o
        cc -g   -I. -I. 
...
...
...
=========================================================

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-31 16:13 UTC] php-bugs at lists dot php dot net
We are sorry, but we do not support PHP 3 related problems anymore.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 03:01:29 2024 UTC