| Bug #39036 | Unsetting key of foreach() yields segmentation fault | ||||
|---|---|---|---|---|---|
| Submitted: | 4 Oct 2006 12:49pm UTC | Modified: | 5 Oct 2006 11:46am UTC | ||
| From: | Bjorn dot Wiberg at its dot uu dot se | Assigned to: | |||
| Status: | Closed | Category: | Reproducible crash | ||
| Version: | 5.1.6 | OS: | AIX 5.2.0 ML8 | ||
[4 Oct 2006 12:49pm UTC] Bjorn dot Wiberg at its dot uu dot se
[4 Oct 2006 1:00pm UTC] tony2001@php.net
Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip Cannot reproduce.
[4 Oct 2006 1:25pm UTC] kian dot mohageri at gmail dot com
Just to chime in, I experienced this same issue with PHP 5.1.6 on
FreeBSD 6.1. I tested the 5.2 snapshot though, and the issue was gone.
I couldn't find a bug for it, though, so I'm not sure when it got fixed.
There were a few somewhat similar reports though relating to unset().
The following code will produce it every time -- but as I said, this is
fixed in the 5.2 snapshot I tried (200610040230).
<?php
$key = 'asdf';
foreach (get_defined_vars() as $key => value) {
unset($$key);
}
?>
[5 Oct 2006 11:42am UTC] Bjorn dot Wiberg at its dot uu dot se
Confirmed OK with php5.2-200610050830 (5.2.0RC5-dev). Wondering if there is some changelog entry for foreach() or unset() which may explain the old (segfaulting) behavior? Otherwise there is a chance that the bug is still latent and may resurface at a later time. Best regards, Björn
[5 Oct 2006 11:46am UTC] tony2001@php.net
No, there is no changelog entry, but I've added a test for it, so it won't appear unnoticed anymore.
