ID:               22052
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         FTP related
 Operating System: FreeBSD 5.0-RELEASE #0
 PHP Version:      4.3.1-dev
 New Comment:

I have a feeling, at this point, that while the new snapshot will stop
your segfault, it'll still not behave in the way you expect it to.

Try this seemingly unrelated script via your httpd server:

<?php
  $fp = tmpfile();
  fwrite($fp, "This is a test.\n");
  rewind($fp);
  fpassthru($fp);
  fclose($fp);
?>
  
Ideally you should see "This is a test" in your browser... if
not....well... does it show an error?


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

[2003-02-13 17:20:36] [EMAIL PROTECTED]

pollita,

    This script only breaks in http method, as the cli returns the
desired output(snafu). The Httpd child dies with a segfault. This
appears to only occur on the OS's listed on the main 4.3 distro of PHP
as well as alot of the snaps I've tried.


currently running FreeBSD 4.7-RELEASE #0: Wed Feb 12 19:59:59 GMT 2003
with php4.3.0 release (very stable).


thanks for your time, as I will try the current snap tomorrow.

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

[2003-02-13 16:49:40] [EMAIL PROTECTED]

Correction, the fix I referred to above didn't make it into the "Feb
13, 2003 22:30 GMT" snapshot, grab one that comes *after* that (i.e.
Feb 14, 2003 00:30 GMT)

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

[2003-02-13 16:06:06] [EMAIL PROTECTED]

I'm trying to understand the problem you're having, but I'm seeing some
slightly conflicting information so I'd like to figure out if I'm
reading you incorrectly...

Running the following script using the php CLI executable, what is the
*exact* output? (I'm just using ftp.kerneli.org as a known public ftp
server for the sake of example)

<?php
  $fp = ftp_connect("ftp.kerneli.org");
  var_dump($fp);
  ftp_login($fp, "anonymous","[EMAIL PROTECTED]");
  var_dump($fp);
  var_dump(ftp_nlist($fp,"/"));
  var_dump($fp);
?>

Don't take this request as demeaning or belittleing, I'm just trying to
approach this problem one step at a time.

Note: be sure to grab the latest snapshot (Dated after: Feb 13, 2003
21:00 GMT) before you try this out, I've just recently fixed a segfault
in the ftp extension which *may* be related.

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

[2003-02-05 15:51:21] [EMAIL PROTECTED]

this is broken with following configurations:

FreeBSD 5 RELEASE 0# php-4.2.3(release)
FreeBSD 5 RELEASE 0# php-4.3.0(release)
FreeBSD 5 RELEASE 0# php-4.3.1-dev (current snap)
FreeBSD 4.7 RELEASE 0# php-4.3.1-dev (current snap)

but works on:
FreeBSD 4.7 RELEASE 0# php-4.3.0 (release)
FreeBSD 4.5 RELEASE 0# php-4.3.0 (release)

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

[2003-02-04 16:46:39] [EMAIL PROTECTED]

got a php dump finally:
gdb `which php` php.core.1
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 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-undermydesk-freebsd"...
Core was generated by `php'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/local/lib/mysql/libmysqlclient.so.10...done.
Loaded symbols for /usr/local/lib/mysql/libmysqlclient.so.10
Reading symbols from /usr/local/lib/libming.so.3...done.
Loaded symbols for /usr/local/lib/libming.so.3
Reading symbols from /usr/lib/libm.so.2...done.
Loaded symbols for /usr/lib/libm.so.2
Reading symbols from /usr/local/lib/libgd.so.2...done.
Loaded symbols for /usr/local/lib/libgd.so.2
Reading symbols from /usr/local/lib/libfreetype.so.9...done.
Loaded symbols for /usr/local/lib/libfreetype.so.9
Reading symbols from /usr/local/lib/libpng.so.5...done.
Loaded symbols for /usr/local/lib/libpng.so.5
Reading symbols from /usr/lib/libz.so.2...done.
Loaded symbols for /usr/lib/libz.so.2
Reading symbols from /usr/local/lib/libjpeg.so.9...done.
Loaded symbols for /usr/local/lib/libjpeg.so.9
Reading symbols from /usr/lib/libcrypt.so.2...done.
Loaded symbols for /usr/lib/libcrypt.so.2
Reading symbols from /usr/lib/libc.so.5...done.
Loaded symbols for /usr/lib/libc.so.5
Reading symbols from /usr/libexec/ld-elf.so.1...done.
Loaded symbols for /usr/libexec/ld-elf.so.1
#0  _efree (ptr=0x0, __zend_filename=0x0, __zend_lineno=0,
__zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_alloc.c:215
215             CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0  _efree (ptr=0x0, __zend_filename=0x0, __zend_lineno=0,
__zend_orig_filename=0x0, __zend_orig_lineno=0)
    at /usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_alloc.c:215
#1  0x0806c127 in ftp_chdir (ftp=0xffffffdc, dir=0x0) at
/usr/ports/www/mod_php4/work/php-4.3.0/ext/ftp/ftp.c:425
#2  0x080693e2 in zif_ftp_chdir (ht=0, return_value=0x8244724,
this_ptr=0x0, return_value_used=0)
    at /usr/ports/www/mod_php4/work/php-4.3.0/ext/ftp/php_ftp.c:299
#3  0x0817a56b in execute (op_array=0x823f000) at
/usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_execute.c:1596
#4  0x0817a788 in execute (op_array=0x8237080) at
/usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_execute.c:1640
#5  0x0817a788 in execute (op_array=0x82201a4) at
/usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_execute.c:1640
#6  0x0816990c in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend.c:864
#7  0x0813919b in php_execute_script (primary_file=0xbfbffb64) at
/usr/ports/www/mod_php4/work/php-4.3.0/main/main.c:1582
#8  0x08180183 in main (argc=2, argv=0xbfbffbc4) at
/usr/ports/www/mod_php4/work/php-4.3.0/sapi/cli/php_cli.c:753
#9  0x080647f5 in _start ()
(gdb) frame 3
#3  0x0817a56b in execute (op_array=0x823f000) at
/usr/ports/www/mod_php4/work/php-4.3.0/Zend/zend_execute.c:1596
1596                                                           
((zend_internal_function *) EX(function_state).function)->
handler(EX(opline)->extended_value,
EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr,
return_value_used TSRMLS_CC)
;

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/22052

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

Reply via email to