#25620 [WFx]: Crash / "String is not zero-terminated"
| From: | xris at farcaster dot net | Date: | Sun, 28 Sep 2003 20:21:20 +0000 |
| Subject: | #25620 [WFx]: Crash / "String is not zero-terminated" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-48207@lists.php.net to get a copy of this message | ||
ID: 25620
User updated by: xris at farcaster dot net
Reported By: xris at farcaster dot net
Status: Wont fix
Bug Type: Scripting Engine problem
Operating System: GNU/Linux 2.4.20
PHP Version: 4.3.4-dev
New Comment:
OK. Thanks to you all for your help and efforts anyway.
Keep up the good work, your are doing a tremendous job.
Previous Comments:
------------------------------------------------------------------------
[2003-09-28 16:17:56] sniper@php.net
So it is the same basic problem as in bug #22510 and is 'fixed' in
PHP5. This will not be fixed in PHP 4.
------------------------------------------------------------------------
[2003-09-27 21:23:24] xris at farcaster dot net
I had to modify some minor stuff of the script (our system) to get it
working with php5.
Then php complained on a couple of occasions about an illegal return
value for a refercence return method ( we had some calls like the one
in my "Example 2" and some methods doing "return new XYZ();).
I fixed these by first assigning the return value to a
variable, then returned this var.
After that, php5 ran the code without complaints/errors.
The same (modified) code, run by the php4 version, still throws the
error.
------------------------------------------------------------------------
[2003-09-27 13:20:19] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2003-09-27 12:07:11] xris at farcaster dot net
So far i checked 600 methods, but could'nt find any
return's similar to your examples. What about these
constructs, are they known to cause heap corruption, too?
// Example 1
function &return_ref_constant() {
return FALSE; // or "return (1<2):"
}
// Example 2
function &a() {
return $b
}
function &return_ref_method() {
return $this->a();
}
// Example 3
function &return_ref_array() {
return array();
}
Yes, i know, some of them are "wrong".
------------------------------------------------------------------------
[2003-09-27 11:00:41] moriyoshi@php.net
Seems to me the same issue addressed in bug #22510. I suspect you are
trying to return a value by reference that is not originated from a
variable somewhere in a function. That is,
function &return_ref_a() {
return $a + $b;
}
function &return_ref_b() {
return @$a;
}
function &return_ref_c() {
return -$a;
}
None of the above examples don't actually work, which are verified to
cause random heap corruption. Please check if such an error is
somewhere in your code.
------------------------------------------------------------------------
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/25620
--
Edit this bug report at http://bugs.php.net/?id=25620&edit=1