From:             kismet at 56 dot com
Operating system: windows xp sp2 
PHP version:      6CVS-2005-11-25 (snap)
PHP Bug Type:     Apache2 related
Bug description:  can't open the page autoshow.php

Description:
------------
apache.exe application error
 "0x0076cc6a" instruction referenced memory "0x45532730"
 can not be readed.


Reproduce code:
---------------
<?
ob_start();
$dsn = 'sqlite:view.db';
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sqlno = 'SELECT max(serial) FROM picture';
    $sthno = $dbh->prepare($sqlno);
    $sthno->execute();
    $res = $sthno->fetch();
    $maxnum = $res[0];
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
}

if (!$num)
{
$num = 1;
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sql = 'SELECT length,code FROM picture where serial ='.$num;
    $sth = $dbh->prepare($sql);
    $sth->execute();
    $result = $sth->fetch();
    $dsn=null;
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
   $dsn=null;
}
header("Content-type: image/jpeg");
header("Refresh:2;URL=autoshow.php");
echo base64_decode($result[1]);
setcookie("num",$num+1);
}
elseif($num <= $maxnum)
{
        $num=$_COOKIE["num"];
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sql = 'SELECT length,code FROM picture where serial ='.$num;
    $sth = $dbh->prepare($sql);
    $sth->execute();
    $result = $sth->fetch();
    $dsn=null;
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
   $dsn=null;
}
header("Content-type: image/jpeg");
header("Refresh:2;URL=autoshow.php");
echo base64_decode($result[1]);
setcookie("num",$num+1);
}
else
{
 print "<script language=\"javascript\">";
 print "alert (\"È«²¿Í¼Æ¬ÏÔʾÍê³É\");";
 print "window.close();";
 print "</script>"; 
}
?>

Expected result:
----------------
the page refreshed every 2 second to show anther picture

Actual result:
--------------
just show the first picture then it core down.

-- 
Edit bug report at http://bugs.php.net/?id=35383&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35383&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35383&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35383&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35383&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35383&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35383&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35383&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35383&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35383&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35383&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35383&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35383&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35383&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35383&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35383&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35383&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35383&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35383&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35383&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35383&r=mysqlcfg

Reply via email to