Bug #14221: Segmentation fault when using class that accesses member functions & variables.
| From: | nickj at nickj dot org | Date: | Mon, 26 Nov 2001 07:22:09 +0000 |
| Subject: | Bug #14221: Segmentation fault when using class that accesses member functions & variables. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-71617@lists.php.net to get a copy of this message | ||
From: nickj@nickj.org
Operating system: Linux Mandrake 7.2
PHP version: 4.0.4pl1
PHP Bug Type: Reproducible crash
Bug description: Segmentation fault when using class that accesses member functions &
variables.
The problem: Segmentation fault when using class that accesses member
functions & variables.
A short script that reproduces the problem:
[note, this is a command line script, but an equivalent web script doesn't
work either]
========================================================
#!/usr/bin/php -q
<?php
error_reporting (E_ALL);
class test {
var $currentField;
function setCurrentField($field_name) {
$this->currentField = $field_name;
}
function getValue($field_name) {
return "getValue with arg - $field_name\n";
}
function getValue() {
return $this->getValue($this->currentField);
}
}
$frm = new test;
$frm->setCurrentField("blah");
print $frm->getValue();
?>
========================================================
What happens:
[root tmp]# ./file.php
Segmentation fault (core dumped)
[root tmp]#
What I would expect to happen:
[root tmp]# ./file.php
getValue with arg - blah
[root tmp]#
============================================
Extra info about the setup being used:
O/S is Linux Mandrake 7.2 with the shipped Linux 2.2.17 kernel, and the
installed PHP uses updated RPMs that are available from the distribution's
web site.
Excerpts from phpinfo() shows:
PHP Version 4.0.4pl1
Configure Command './configure' '--with-apxs=/usr/sbin/apxs'
'--without-mysql' '--disable-static' '--disable-debug'
'--enable-pic'
'--enable-inline-optimization' '--prefix=/usr' '--with-zlib'
'--with-config-file-path=/etc' '--enable-magic-quotes'
'--enable-debugger'
'--enable-track-vars' '--enable-safe-mode' '--with-exec-dir=/usr/bin'
'--with-regex=system' '--with-versioning' '--enable-dba=shared'
'--with-gdbm' '--with-db2' '--enable-sysvsem'
'--enable-sysvshm'
'--with-mod_charset' '--enable-force-cgi-redirect' '--with-mm'
'--enable-trans-sid' '--with-dbase' '--with-filepro'
'--enable-yp'
'--enable-ftp' '--with-xml' '--with-gettext'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc
ZEND_DEBUG disabled
Thread Safety disabled
This program makes use of the Zend scripting language engine:
Zend Engine v1.0.4, Copyright (c) 1998-2000 Zend Technologies
with Zend Optimizer v1.1.0, Copyright (c) 1998-2000, by Zend
Technologies
=============================================
Any extra info that I can provide that would help, please just let me
know.
Kind Regards,
Nick.
--
Edit bug report at: http://bugs.php.net/?id=14221&edit=1