ID: 27380
Updated by: [EMAIL PROTECTED]
Reported By: josh at hostyour dot info
-Status: Feedback
+Status: No Feedback
Bug Type: Reproducible crash
Operating System: RH7.3
PHP Version: 4.3.4
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2004-02-24 17:04:08] [EMAIL PROTECTED]
And ditch the mysql stuff from the reproducing script..
(a GDB backtrace might reveal something too?)
------------------------------------------------------------------------
[2004-02-24 11:32:05] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
Can't reproduce this with only a part of a script.
------------------------------------------------------------------------
[2004-02-24 11:26:11] josh at hostyour dot info
Description:
------------
If I have a function that has a do..while(); construction in it, inside
a block container { }, PHP will segfault on exiting the block container
UNLESS I have a statement in between the end of the while (); and the
closing brace of the block.
This does NOT happen in "global" execution. A do..while() loop that
lives outside any function's scope works just fine; I have several
other do..while() constructs outside of functions that work with no
problems. The segfault seems to only happen when the do..while(); is
inside a function AND inside a block container (in this case, belonging
to an if statement).
Any ideas?
Reproduce code:
---------------
function announce()
{
global $totalRows_announce, $row_announce, $announce, $srs;
$ann = "";
if ($totalRows_announce > 0) {
do {
$author = mysql_result(mysql_query("SELECT nick FROM players
WHERE
id='".$row_announce['author']."'", $srs), 0, "nick") or
die(mysql_error());
$msg_body =
stripslashes(implode("<br>",explode("\n",$row_announce['msg_body'])));
$ann .= textBlock(textBlock($row_announce['subject'], "",
"anntitle") . br() .
textBlock("Posted by:".$author." | On:
".$row_announce['posted_date'], "", "annhead") . br() .
textBlock($msg_body, "", "annbody"), "",
(($row_announce['urgent']
== 1) ? "redrow" : ((($ctr++) % 2) ? "lightrow" : "darkrow"))) . br();
} while ($row_announce = mysql_fetch_assoc($announce));
// Segfault happens HERE
} else {
$ann = textBlock("No Announcements", "", "loginerr");
}
return $ann;
}
Expected result:
----------------
The code, as intended, returns a string of HTML code to the calling
function.
Actual result:
--------------
The code immediately segfaults when it encounters the closing brace of
the do..while() loop's block container UNLESS there is an intervening
statement.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27380&edit=1