bugMibble MIB Parser - Bugs: bug #8863, Missing symbol import cause error...

 
 

bug #8863: Missing symbol import cause error instead of warning

Submitter:  None
Submitted:  Mon 10 May 2004 05:01:36 PM UTC
   
 
Severity:  5 - Major Item Group:  Software
Status:  Fixed Privacy:  Public
Assigned to:  cederberg Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 27 May 2004 01:28:22 PM UTC, comment #6: 

Version 2.4 has been released. Closing bug.

Per Cederberg <cederberg>
Group administrator
Wed 26 May 2004 10:29:25 PM UTC, comment #5: 

Fixed. A new recovery mechanism has been added when looking up symbol, searching in all imported MIBs if a symbols is not found in the explicit import list.

This fix will be released in version 2.4 (soon).

Per Cederberg <cederberg>
Group administrator
Tue 11 May 2004 08:38:07 PM UTC, comment #4: 

This issue was previously mentioned in bug #7113, but I'll keep the two bugs separate for clarity. Also modified the bug summary to describe the issue better.

Per Cederberg <cederberg>
Group administrator
Tue 11 May 2004 08:30:12 PM UTC, comment #3: 

Ok, I can confirm that this is a bug. I was appearently doing some wishful thinking while writing my previous comment, as that is not exacly how Mibble works. At least that is what I found out now that I actually sat down and read the code again... :-)

Mibble does indeed ignore the export declaration. However, when looking up symbols inside a MIB file, it explicitly only finds symbols that have been imported. It's a trivial piece of code to fix, and I must have written it a day when I was feeling particularily pedantic. See MibReference.java at line 143-144:

        } else if (symbols != null && !symbols.contains(name)) {
            return null;

By commenting these two lines out, Mibble will effectively ignore whatever symbols were listed in the IMPORT declaration and assume that all symbols were imported. This may of course cause problems if the same symbol name is declared in two different MIB files both on the import list, but that should be a very rare situation.

The other workaround is of course to correct the MIB files in question and include the missing import.

The next version of Mibble will include a proper fix for this issue, issuing a warning in case a symbol was used but not imported.

Per Cederberg <cederberg>
Group administrator
Mon 10 May 2004 08:53:57 PM UTC, comment #2: 

I was looking at the Motorola MIB definition of one of their device with following import statements:

IMPORTS
IpAddress, TimeTicks FROM RFC1155-SMI

The RFC1155-SMI also contains definition of the "Counter" object type, which was not imported explicitly but was used in the motorola mib file.

The following export declaration from RFC1155-SMI
EXPORTS -- EVERYTHING
        internet, directory, mgmt,
        experimental, private, enterprises,
        OBJECT-TYPE, ObjectName, ObjectSyntax, SimpleSyntax,
        ApplicationSyntax, NetworkAddress, IpAddress,
        Counter, Gauge, TimeTicks, Opaque;

I got a Mib load error on motorola mib trying to find "Counter". I only add the directory which contains the MIB file to the MIB search path and do not explictly load the RFC1155-SMI mib file before loading the motorola mib. I have had to modify the motorola mib to import definition of object type "Counter" for it to work.

I would think that the ideal behavior should be that when importing a definition from another mib file, references of all the exports should be created, so that if any exported object type is not explicitly imported, it should not cause an error.

Vivek S Srivastav <yantriki>
Mon 10 May 2004 07:01:18 PM UTC, comment #1: 

I don't understand what you mean with this bug. It is true that the EXPORT clause is ignored, using an EXPORT ALL policy instead. Mibble was designed this way to avoid problems with the many MIB files that do not properly export all the symbols they mean to export. Are you having problems with the import mechanism?

Granted, it should be possible to parse files in a strict mode where things such as importing a non-exported symbol should cause a warning. See bug #4367 and bug #7113 for more information about this idea.

Per Cederberg <cederberg>
Group administrator
Mon 10 May 2004 05:01:36 PM UTC, original submission:  

If an imported MIB contains EXPORT clause all such definition should be available in the importing MIB files. mibble 2.2 throws an exception not found.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-05-27 cederberg Open/ClosedOpen Closed
2004-05-26 cederberg StatusNone Fixed
2004-05-11 cederberg SummaryThe &quot;EXPORT&quot; clause in the imported mib files are being ignored Missing symbol import cause error instead of warning
2004-05-11 cederberg Assigned toNone cederberg
2004-05-10 yantriki Carbon-Copy- Added vsrivastav --AT-- optinel --DOT-- com

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code