From: andy_wolk at mail dot ru
Operating system: Windows 2003 Server Enterprise
PHP version: 5.2.5
PHP Bug Type: SNMP related
Bug description: SNMP cause "PHP has encountered an Access Violation" when
wrong IP or CommStr
Description:
------------
SNMP functions cause "PHP has encountered an Access Violation" when wrong
IP or Community String.
IIS 6 + PHP5.2.2dev isapi module.
PHP_snmp.dll (ver 5.2.2.2)
All next php versions has the same problem.
After this error, IIS does not can operate with snmp module and needs to
be restarted.
Event viewer: Faulting application w3wp.exe, version 6.0.3790.3959,
faulting module unknown, version 0.0.0.0, fault address 0x010cfdf4.
No errors in php_error.log
Reproduce code:
---------------
<html>
<head>
<title></title>
</head>
<body>
<?php
echo "Start...";
flush();
$communitystring=''; // Your device must have this string no empty!
$ip='10.200.202.97'; // Sometimes this error occured, when there is no
Device in a network with this IP.
for ($i=1;$i<14;$i++)
{
$port=100+$i;
$oid='.1.3.6.1.2.1.26.2.1.1.5.${port}.1';
@snmpget($ip,$communitystring,$oid);
$oid='.1.3.6.1.2.1.26.2.1.1.5.${port}.1';
@snmpwalk($ip,$communitystring,$oid);
$oid='.1.3.6.1.2.1.2.2.1.7.${port}';
@snmpget($ip,$communitystring,$oid);
$oid='.1.3.6.1.2.1.2.2.1.7.${port}';
@snmpwalk($ip,$communitystring,$oid);
$oid='.1.3.6.1.4.1.43.10.22.1.1.3.1.$i';
@snmpget($ip,$communitystring,$oid);
$oid='.1.3.6.1.4.1.43.10.22.1.1.3.1.$i';
@snmpwalk($ip,$communitystring,$oid);
$oid='.1.3.6.1.4.1.43.10.22.1.1.5.1.$i';
@snmpget($ip,$communitystring,$oid);
$oid='.1.3.6.1.4.1.43.10.22.1.1.5.1.$i';
@snmpwalk($ip,$communitystring,$oid);
$oid='.1.3.6.1.2.1.26.2.1.1.3.${port}.1';
@snmpget($ip,$communitystring,$oid);
$oid='.1.3.6.1.2.1.26.2.1.1.3.${port}.1';
@snmpwalk($ip,$communitystring,$oid);
}
echo "Finish";
?>
</body>
</html>
Expected result:
----------------
Start...Finish
Actual result:
--------------
Start...PHP has encountered an Access Violation at xxxxxxxx
--
Edit bug report at http://bugs.php.net/?id=43410&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43410&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43410&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43410&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43410&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43410&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43410&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43410&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43410&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43410&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43410&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43410&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43410&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43410&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43410&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43410&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43410&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43410&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43410&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43410&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43410&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43410&r=mysqlcfg