Re: [tkined] HP-UX 11.00, scotty exits with Bus error

Tom Bertelson (Tom.Bertelson@abnamro.com)
Fri, 09 Jul 1999 12:32:31 -0500

Johan Johansen wrote:
>
> I am running scotty-2.1.10 with tcl/tk 8.0.3 on my
> HP-UX B.11.00 E 9000/780
>
> Every time I do a "mib oid sysUpTime", I get a lot of
> /usr/local/lib/tnm2.1.10/mibs/rfc1472.mib: no parent pppSecurityConfigEntry
> for node pppSecurityConfigLink
>
> and then
> Bus error (core dumped)
>
> This does not happen on a system running HP-UX 10.20

I had exactly the same problem with HP-UX 10.20. The problem is that
DEFVAL definitions point to corrupted memory, which create corrupted
frozen files.

Here's a patch for it. It also fixes a problem where symbols greater
than SYMBOL_MAXLEN crash scotty instead of returning an error.

--- ../tnm/snmp/tnmMibParser.c.orig Thu Jul 9 08:05:10 1998
+++ ../tnm/snmp/tnmMibParser.c Fri Jul 2 14:18:42 1999
@@ -17,7 +17,8 @@
#include "tnmSnmp.h"
#include "tnmMib.h"

-#define SYMBOL_MAXLEN 64 /* Maximum # characters in a symbol. */
+/* LanMgr-Alerts-II-MIB exceeds the old value (64) */
+#define SYMBOL_MAXLEN 128 /* Maximum # characters in a symbol. */

/*
* Token used by the MIB parser.
@@ -2098,6 +2099,7 @@
Tcl_DStringFree (&dst);
break;
case DEFVAL:
+ Tcl_DStringInit (&dst);
if ((syntax = ReadKeyword(fp, keyword)) != LEFTBRACKET) {
return NULL;
}
@@ -2105,8 +2107,10 @@
if (syntax == EOF) {
return NULL;
}
- nodePtr->index = keyword;
+ Tcl_DStringAppendElement (&dst, keyword);
}
+ nodePtr->index = ckstrdup (Tcl_DStringValue (&dst));
+ Tcl_DStringFree (&dst);
break;
case EOF:
return NULL;
@@ -2204,6 +2208,7 @@
char *cp = keyword;
int ch = lastchar;
int hash_val = 0;
+ int len;

Keyword *tp;

@@ -2225,7 +2230,7 @@
*/

if (ch == '"') {
- int len = 0;
+ len = 0;
*keyword = '\0';
while ((ch = getc (fp)) != EOF) {
if (ch == '\n') {
@@ -2267,6 +2272,7 @@
* Read characters until end of keyword is found
*/

+ len = 0;
do {
if (ch == '\n') line++;

@@ -2329,6 +2335,10 @@
* build keyword and hashvalue
*/

+ if (len++ > SYMBOL_MAXLEN - 2) {
+ *cp = '\0';
+ return EOF;
+ }
hash_val += ch;
*cp++ = ch;
}

After applying the patch, delete then recreate all your frozen MIB
files.
Good luck!

-- 
Tom Bertelson                   "Any sufficiently advanced technology
ABN AMRO                         is indistinguishable from magic."
Tom.Bertelson@abnamro.com          -- Arthur C. Clarke
--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.