Re: ext/snmp unit tests

From: Date: Mon, 21 Mar 2011 18:49:19 +0000
Subject: Re: ext/snmp unit tests
References: 1 2 3  Groups: php.qa 
Request: Send a blank email to php-qa+get-65758@lists.php.net to get a copy of this message
Here's a GDB trace, which should help you. Apparently it's a bug in the snmp lib. I've zero knowledge about this lib, though. Let me know if you need more info. (gdb) n
582             char *buf = &(sbuf[0]);
(gdb)
583             char *dbuf = (char *)NULL;
(gdb)
584             int buflen = sizeof(sbuf) - 1;
(gdb)
585             int val_len = vars->val_len;
(gdb)
587             if (valueretrieval == SNMP_VALUE_LIBRARY) {
(gdb)
588                     val_len += 32; /* snprint_value will add type info into value, make some space for it */
(gdb)
592             if(val_len > buflen){
(gdb)
593                     if ((dbuf = (char *)emalloc(val_len + 1))) {
(gdb)
594                             buf = dbuf;
(gdb)
595                             buflen = val_len;
(gdb)
601             *buf = 0;
(gdb)
603             if (valueretrieval == SNMP_VALUE_LIBRARY) {
(gdb)
604                     SNMP_SNPRINT_VALUE(buf, buflen, vars->name, vars->val_len, vars);
(gdb)
605                     ZVAL_STRING(snmpval, buf, 1);
(gdb) p buf $3 = 0xbb63ec "STRING: " (gdb) p val_len $4 = 110 (gdb) p *vars $5 = {next_variable = 0x0, name = 0x9786758, name_length = 9, type = 4 '\004', val = {integer = 0x9786990, string = 0x9786990 "Linux nex1.php.net 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686", objid = 0x9786990, bitstring = 0x9786990 "Linux nex1.php.net 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686", counter64 = 0x9786990, floatVal = 0x9786990, doubleVal = 0x9786990}, val_len = 78, name_loc = {1, 3, 6, 1, 2, 1, 1, 1, 0 <repeats 120 times>}, buf = '\000' <repeats 39 times>, data = 0x0, dataFreeHook = 0, index = 0} Nuno ----- Original Message -----
Hi. There is one test failing on your test environment that I can neither reproduce nor trace in source code: http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tests&file=ext%2Fsnmp%2Ftests%2Fsnmp_getvalue.phpt Is there any way to get some debugging info helping me to fix this test? On Mon, Feb 14, 2011 at 1:08 AM, Nuno Lopes <nlopess@php.net> wrote:
I've enabled the snmpd deamon with your config file.
-- Boris


« previous php.qa (#65758) next »