#23388 [Opn->Dup]: fopen with empty parameters and timeout of 1 causes segfault

From: Date: Mon, 28 Apr 2003 20:51:58 +0000
Subject: #23388 [Opn->Dup]: fopen with empty parameters and timeout of 1 causes segfault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38650@lists.php.net to get a copy of this message
 ID:               23388
 Updated by:       wez@php.net
 Reported By:      justmanj at msu dot edu
-Status:           Open
+Status:           Duplicate
 Bug Type:         Sockets related
 Operating System: os x 10.2.5
 PHP Version:      4.3.0
 New Comment:

Duplicate of #21529.
Already fixed in CVS; please try a stable snapshot from
http://snaps.php.net


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

[2003-04-28 13:21:11] justmanj at msu dot edu

reproduceable segmentation fault on osx 10.2.5 when the following code
is executed and attempting to connect to a host with a closed port:

if($fp = fsockopen($host, $port, $errno, $errstr, 1))

please note, this is without initilizing $errno and $errstr.

connecting to a valid host will not result in any problems, but
attepting to connect to an invalid host/port will cause php to segfault
at the termination of the script

Upon adding a $errno = "" and $errstr = "" before the fsockopen call,
this problem is alleviated.

Backtrace:

Date/Time:  2003-04-28 14:18:06 -0400
OS Version: 10.2.5 (Build 6L29)
Host:       ellison

Command:    php
PID:        5701

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0x00520000

Thread 0 Crashed:
 #0   0x000bd53c in shutdown_memory_manager (zend_alloc.c:461)
 #1   0x000a2e60 in php_request_shutdown (main.c:950)
 #2   0x000e0e68 in main (php_cli.c:805)
 #3   0x00001f94 in _start (crt.c:267)
 #4   0x00001e14 in start

PPC Thread State:
  srr0: 0x000bd53c srr1: 0x0200f030                vrsave: 0x00000000
   xer: 0x00000000   lr: 0x000bd558  ctr: 0x90003dc0   mq: 0x00000000
    r0: 0x00000000   r1: 0xbfffe310   r2: 0x00000000   r3: 0x00488390
    r4: 0x00487310   r5: 0x00000009   r6: 0x00118bf0   r7: 0x00000000
    r8: 0x00422010   r9: 0x00520000  r10: 0x00422290  r11: 0x0011a470
   r12: 0x90003dc0  r13: 0x00000000  r14: 0x00000000  r15: 0x00000000
   r16: 0x00000000  r17: 0x00000000  r18: 0x00000000  r19: 0x00000000
   r20: 0x00000000  r21: 0x00000000  r22: 0x00000000  r23: 0x00000000
   r24: 0x00000000  r25: 0x00000003  r26: 0x0011d4d4  r27: 0x0011d080
   r28: 0x0000000c  r29: 0x00000001  r30: 0x00000c04  r31: 0x000bd4d4



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


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



Thread (3 messages)

« previous php.bugs (#38650) next »