#23388 [NEW]: fopen with empty parameters and timeout of 1 causes segfault

From: Date: Mon, 28 Apr 2003 18:21:12 +0000
Subject: #23388 [NEW]: fopen with empty parameters and timeout of 1 causes segfault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38647@lists.php.net to get a copy of this message
From: justmanj at msu dot edu Operating system: os x 10.2.5 PHP version: 4.3.0 PHP Bug Type: Sockets related Bug description: fopen with empty parameters and timeout of 1 causes segfault 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 bug report at http://bugs.php.net/?id=23388&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23388&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23388&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23388&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23388&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23388&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23388&r=support Expected behavior: http://bugs.php.net/fix.php?id=23388&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23388&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23388&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23388&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23388&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23388&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23388&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23388&r=gnused

« previous php.bugs (#38647) next »