From:             csmall at enc dot com dot au
Operating system: Linux
PHP version:      4CVS-2003-04-04 (stable)
PHP Bug Type:     SNMP related
Bug description:  snmpwalkoid doesnt work on alphas

This problem has been around at least since 4.3.2, you might also want to
look at http://bugs.debian.org/185534

snmprealwalk and snmpwalkoid fail to work properly on my alpha.  snmpwalk
used to not work but now does.  Version is
php4-STABLE-200304041230

./configure line was
'--enable-debug' \
'--with-bz2' \
'--with-snmp' \
'--with-openssl' \

This is the test code:
<?
$host='myhostname';
$community='mysecret';

$ifDescr =
snmpwalkoid("$host","$community","interfaces.ifTable.ifEntry.ifDescr");
var_dump($ifDescr);

?>

Output is:
---------
array(1) {
  ["interfaces.ifTable.ifEntry.ifDescr.1"]=>
  string(42) "interfaces.ifTable.ifEntry.ifDescr.6 = br0"
}
--------
This is broken, as this is the result of the last (6th) interface in the
place of the first, notice the key says ifDesc.1 and the result says
ifDescr.6

This is what a i386 running Debian 4.2.3-13 on the exact same script
does:
---------
array(6) {
  ["interfaces.ifTable.ifEntry.ifDescr.1"]=>
  string(41) "interfaces.ifTable.ifEntry.ifDescr.1 = lo"
  ["interfaces.ifTable.ifEntry.ifDescr.2"]=>
  string(43) "interfaces.ifTable.ifEntry.ifDescr.2 = eth0"
  ["interfaces.ifTable.ifEntry.ifDescr.3"]=>
  string(43) "interfaces.ifTable.ifEntry.ifDescr.3 = eth1"
  ["interfaces.ifTable.ifEntry.ifDescr.4"]=>
  string(43) "interfaces.ifTable.ifEntry.ifDescr.4 = gre0"
  ["interfaces.ifTable.ifEntry.ifDescr.5"]=>
  string(43) "interfaces.ifTable.ifEntry.ifDescr.5 = sit0"
  ["interfaces.ifTable.ifEntry.ifDescr.6"]=>
  string(42) "interfaces.ifTable.ifEntry.ifDescr.6 = br0"
}
------

I ran some tests on the 4.2.3 code and it was definitely returning the
right and multiple values.  I basically enabled the Debug() line in snmp.c
and saw the return string come back the way I expected.


So it looks like some pointer or array is getting overwritten.  I tried
linking in electric fence but libsnmp is too buggy and it died within the
library loading up the mibs.

-- 
Edit bug report at http://bugs.php.net/?id=23051&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23051&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23051&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23051&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23051&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23051&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23051&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23051&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23051&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23051&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23051&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23051&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23051&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23051&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23051&r=gnused

Reply via email to